Permalink
Browse files

Add tupled order method overload (for use with the "operator" syntax)

  • Loading branch information...
1 parent 10feab8 commit e302e103e6956eb68183ac65b306173ec620d0c1 @teozkr committed Jun 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 nina/src/main/scala/Query.scala
View
3 nina/src/main/scala/Query.scala
@@ -48,7 +48,8 @@ case class GetQuery[A, T <: Table](query: Query[T], cols: T#Columns[A], ordering
case Some((col, dir)) => Some((col.name, dir))
}
- def order(column: query.table.Column[_], direction: OrderDirection) = GetQuery(query, cols, Some((column, direction)))
+ def order(column: query.table.Column[_], direction: OrderDirection) = order((column, direction))
+ def order(columnAndDirection: (query.table.Column[_], OrderDirection)) = GetQuery(query, cols, Some(columnAndDirection))
def single()(implicit conn: Connection): Option[A] = query.table.executor.getOne(query.table.tableName, query.filters, cols.columnNames, stringifiedOrdering).map(cols.bindFromMap(_).value)
def take(amount: Long)(implicit conn: Connection): Seq[A] = query.table.executor.getMultiple(query.table.tableName, query.filters, cols.columnNames, stringifiedOrdering, amount).map(cols.bindFromMap(_).value)

0 comments on commit e302e10

Please sign in to comment.