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 ...

+ Reply to Thread
Results 1 to 2 of 2

TopLink: sorting entities by boolean value

  1. Default 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

  2. Default 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...


+ Reply to Thread

Similar Threads

  1. toplink postgres default
    By Application Development in forum JDBC JAVA
    Replies: 0
    Last Post: 11-21-2007, 05:08 AM
  2. Toplink EJB and cascade persistence
    By Application Development in forum Java
    Replies: 2
    Last Post: 10-09-2007, 10:31 AM
  3. Oracle toplink 10g - No primary table is specified
    By Application Development in forum JDBC JAVA
    Replies: 0
    Last Post: 06-14-2007, 10:45 AM
  4. TopLink/Java goes to Open Source, what about TopLink/Smalltalk?
    By Application Development in forum Smalltalk
    Replies: 3
    Last Post: 03-21-2007, 08:34 PM
  5. Oracle TopLink + composite mapping
    By Application Development in forum JDBC JAVA
    Replies: 2
    Last Post: 10-30-2006, 05:02 PM