Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:3.0[/b]
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():
session = HibernateUtil.currentSession();
session.connection().setAutoCommit(true);
Query query = session.createQuery("FROM User u WHERE u.isDeleted = :isDeleted ORDER BY u.name");
query.setParameter("isDeleted", new Boolean(false));
Iterator iterate = query.list().iterator();
while (iterate.hasNext())
{
User user = (User)iterate.next();
System.out.println("userName: " + user.getName());
}
[/b]
[b]Full stack trace of any exception that occurs:[/b]
[b]Name and version of the database you are using:postgresql 8.0[/b]
[b]The generated SQL (show_sql=true):
Hibernate: select user0_.id as id, user0_.name as name2_, user0_.description as descript3_2_, user0_.password as password2_, user0_.is_admin
as is5_2_, user0_.login_date as login6_2_, user0_.locked_date as locked7_2_, user0_.last_ip as last8_2_, user0_.is_deleted as is9_2_ from s
msc_user user0_ where (user0_.is_deleted=?) order by user0_.name
[/b]
[b]Debug level Hibernate log excerpt:[/b]
Hi, am actually doing a simple query where there is an order by. But I never get my data in an ordered way.
Here are my results:
userName: parabole
userName: new_user
userName: radio
userName: gul2
userName: gulshan
Can anyone please help me solve my problem
thanks in advance