Joined: Mon Feb 09, 2004 6:45 pm Posts: 10 Location: Feltre, BL Italy
|
Hi all
I'm using Hibernate 2.0.3
I'm getting a list of items out of the persistent store using Criteria.list.
The Criteria instance can be set up with some Expression and/or Order
according to the user input in a suitable dialog.
When I use the Order part only (meaning that I do not want any selection
at all, but I do want the list be sorted), the Criteria.list() method
throws an exception (NullPointerException) A look by some debugger confirms this got raised since the Expression part in null.
So: Should the Expression *AND* the Order part of a Criteria instance
be set in order to get a valid Criteria instance?
Is there any way to use it to get all records, but sorted in the set way
(apart from the trivial solution to set: Expression.sql("SELECT * FROM Item"))?
thanks in advance
davide
|
|