val arbitratyArgs = ...
from(userItems, typeHierarchies)((ui, th) =>
where(ui.userId === user.idField
and ui.typeHierarchyId === th.idField
and ui.typeHierarchyId === topLevelType.id)
select (ui) orderBy(getOrderBy(ui, arbitratyArgs))).toList
def getOrderByValue(ui: UserItem, arbitraryArg: Whatever) =
if (arbitraryArg) // when it gets hairy, you can also use pattern
matching ....
ui.rating desc
else
ui.name asc
It's important that you explicitely call 'asc' or 'desc' when you
externalize the orderBy clause,
ML
2011/11/6 Paul McKinney <pmcki...@gmail.com>: