-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Join table criteria in Hibernate
PostPosted: Tue Aug 20, 2013 2:28 pm 
Newbie

Joined: Tue Aug 20, 2013 2:26 pm
Posts: 1
In the DAO class, I have to join the table class (Table1.class) related to that dao(Table1Dao) class with another class instance table(Table2.class).

What I am trying to do inside Table1Dao is:

Criteria criteria = getSession().createCriteria(Table1.class, "tab1"); criteria.createCriteria("tab1.(Table2.class)", CriteriaSpecification.FULL_JOIN); criteria.add((Restrictions.eq("tab1.(Table2.class).ID", Id)));

This doesnt seem to return a valid query. What would be the correct way to implement it?

Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.