TopLink: sorting entities by boolean value - JDBC JAVA
This is a discussion on TopLink: sorting entities by boolean value - JDBC JAVA ; Hi,
I have a problem when I want to sort entities (order by) by
a boolean field.
TopLink throws following exception:
....
Caused by: Exception [TOPLINK-8021] (Oracle TopLink Essentials - 2006.8
(Build 060830)): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Invalid ORDER BY item ...
-
TopLink: sorting entities by boolean value
Hi,
I have a problem when I want to sort entities (order by) by
a boolean field.
TopLink throws following exception:
....
Caused by: Exception [TOPLINK-8021] (Oracle TopLink Essentials - 2006.8
(Build 060830)): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Invalid ORDER BY item [e.active] of type
[java.lang.Boolean], expected expression of an orderable type.
Thoes it mean that TopLink can't sort by booleans?
Is there any workaround?
As far as I remember Hibernate had no problems doing this.
I will be grateful for any help.
Best regards,
Chris
-
Re: TopLink: sorting entities by boolean value
On 29 Aug, 07:56, "k.adamczyk" <k.adamc...@merge.com.pl> wrote:
> Hi,
>
> I have a problem when I want to sort entities (order by) by
> a boolean field.
> TopLink throws following exception:
> ...
> Caused by: Exception [TOPLINK-8021] (Oracle TopLink Essentials - 2006.8
> (Build 060830)): oracle.toplink.essentials.exceptions.EJBQLException
> Exception Description: Invalid ORDER BY item [e.active] of type
> [java.lang.Boolean], expected expression of an orderable type.
>
> Thoes it mean that TopLink can't sort by booleans?
> Is there any workaround?
> As far as I remember Hibernate had no problems doing this.
>
> I will be grateful for any help.
> Best regards,
> Chris
It may be to do with the fact that different systems use different
values for boolean True and False. You can use CASE() inside your SQL
to convert boolean to something sortable...
Similar Threads
-
By Application Development in forum JDBC JAVA
Replies: 0
Last Post: 11-21-2007, 05:08 AM
-
By Application Development in forum Java
Replies: 2
Last Post: 10-09-2007, 10:31 AM
-
By Application Development in forum JDBC JAVA
Replies: 0
Last Post: 06-14-2007, 10:45 AM
-
By Application Development in forum Smalltalk
Replies: 3
Last Post: 03-21-2007, 08:34 PM
-
By Application Development in forum JDBC JAVA
Replies: 2
Last Post: 10-30-2006, 05:02 PM