File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Question in Hibernate Criteria Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply locked New topic

Question in Hibernate Criteria Query

Saravanan Vijayappan
Ranch Hand

Joined: Jan 02, 2007
Posts: 47

Could any one please help, I referred so many articles but don't get information. I have question in my below Criteria query:-

When you closely look at the query, the association is, Menugroups--(1 to many)-->Catgroups---(1 to many)---> Dealitems. I have configured lazy fetching and have set up batch-size=10 in config file.

When the above query is fired, hibernate generates the below sqls,

My issue here is, the one of the criteria restriction published=true is not applied in the 2nd SQLs. So I am getting unpublished catgroups in the result. Could any one help please what is wrong in my Criteria query and what needs to be added more ?

Reply is appreciated.

[ July 12, 2008: Message edited by: Saravanan Vijayappan ]

Cheers,<br />Sarav
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Please refrain from duplicate posting. I am going to close this dup thread. I am sorry someone hasn't answered the other thread, but hopefully someone will soon.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Question in Hibernate Criteria Query
Similar Threads
Hibernate - Conditions are not applied in Inner Criteria Query
Hibernate: ArryaList Collection associations are not working
Problem with Hibernate Criteria, Projections and associations
Hibernate Criteria Query not working properly
HQL Order By Class is not Sorting