Probably a bug but I thought I should ask first. When trying to a second column in the order clause in Active Object query I get an exception about a missing column:
Caused by: org.postgresql.util.PSQLException: ERROR: column "unit" does not exist
Maybe a PLSQL specific issue. I'm using ao 0.7.12.1 with JIRA 4.4.3
Community moderators have prevented the ability to post new answers.
I had the same problem with Postgres. The trouble is, that upper case table and field names have to be put between double quotes for Postgres. (And ActiveObject creates table and field names all upper case.) Unfortunately the ActiveObject API does not handle this fully transparent.
With this:
.order("FIRST ASC, SECOND ASC")
I got some '... column "second" does not exist' error.
Surprisingly the following worked:
.order("FIRST ASC, \"SECOND\" ASC")
It seems, that only the first order field is put into double quotes within the API. I finally decided to make it at least a bit more consistent like this:
.where("... ORDER BY \"FIRST\" ASC, \"SECOND\" ASC")
This is with ActiveObejcts version 0.19.12 .
How do you create the query? I don't have the chance to test it on PLSQL at the moment, but I can confirm that the following works in MySQL & HSQLDB:
Query.select().order("FIRST ASC, SECOND DESC")
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.