Register / Login
Win a copy of
Java Mock Exams (software)
this week in the
Programmer Certification (OCPJP)
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Object Relational Mapping
Problem in Criteria
posted 9 years ago
I am new to the criteria queries. Previously I have worked on some basic HQL queries.
I am having a problem in writing a criteria query
Here is the structure of my class
I want to write a query like this
select * from C where a.id="somevalue" and b.id="somevalue"
I want to achieve it in single query.
Currently I am doing this
First I am writing two different criteria queries to fetch instances of a and b and then I say
Criteria criteria = DetachedCriteria.forClass(C.class)
My question is - Is there any better way to do that, like getting it in a single criteria?
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
Boost this thread!
How to use DetachedCriteria in multiple table?
Java Routine Running in Servlet Extremenly Slow. Fast on Normal Class.
Inner join in Hibernate
composite key and Criteria API [Hibernate]
Querying on Child Objects