orderBy bug

48 views
Skip to first unread message

Bill Atkins

unread,
Jun 3, 2012, 5:17:39 PM6/3/12
to ScalaQuery
I'm having a strange problem with orderBy. The following query:

for(r <- this if r.isActive is true; _ <- Query orderBy
orderColumn) yield r.mapped

generates a number of duplicates, so I checked the value of
selectStatement to see that the table is being joined to itself:

SELECT
"t1"."id","t1"."name","t1"."default_category_id","t1"."is_active" FROM
"payee" "t1","payee" "t2" WHERE ("t1"."is_active"=true) ORDER BY
"t2"."name"

If I remove the orderBy criterion, there's only one table in the FROM
clause.

Am I doing something wrong?

Stefan Zeiger

unread,
Jun 4, 2012, 9:27:55 AM6/4/12
to scala...@googlegroups.com
On 2012-06-03 23:17, Bill Atkins wrote:
I'm having a strange problem with orderBy. The following query:

   for(r <- this if r.isActive is true; _ <- Query orderBy
orderColumn) yield r.mapped

generates a number of duplicates, so I checked the value of
selectStatement to see that the table is being joined to itself:

Where does orderColumn come from? This needs to be a column in "r", not in "this" (which I assume is the base table).

--
Stefan Zeiger
Typesafe - The software stack for applications that scale
Twitter: @StefanZeiger
Reply all
Reply to author
Forward
0 new messages