In the order clause you may use column numbers instead
of column names, so you would write:
order by 1
Max
> Hi,
>
> I'm writing container-managed-persistence javabeans.
> When i lookup entity beans from my InstanDB database i want
> all entities
> sorted by title.
>
> Normal sql query would be:
> SELECT * FROM table WHERE table.name='bla' ORDER BY table.title
>
> But in JOnAS al sql queries are:
> SELECT id FROM table WHERE table.name='bla'
> and when you want to use 'ORDER BY table.title', table.title
> has to be one
> of the columnnames you return
>
> So in the property of my Deployment Descriptor i have:
>
> ....findByName where name like ?
>
> But i can't add 'order by title' after the statement because
> it will give an
> error like:
> "columnname title must be one of the columnnames you return"
> and that's only 'id'.
>
> Can someone help me with this problem?
>
> thnx
>
> Best regards,
>
> Jochen Vastmans
> [EMAIL PROTECTED]
>
>
>
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
>
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".