Hi everyone, i have some questions with the createCriteria sentence, supose this code:
Criteria query = s.createCriteria(NameOfMyClass.class);
...
//now imagine nameAttribute is a foreign key to another table
query.createCriteria("nameAttribute");
Correct me if i'm wrong, but if i don't add any restriction to this new criteria, the join clause won't appear in the final SQL query?
The last question:
if i make this:
Criteria query = s.createCriteria(NameOfMyClass.class); query.createCriteria("nameAttribute");
query.add(someRestricion)
if(anyCondition){
How can i access to the nameAttribute criteria recently created??
because if i add some restriction hibernate will add in the actual criteria context
}
I admit any suggestion
|