Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Joining table criteria in Hibernate

hibernate criteria join table

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 Aj91


    CC Lurker

  • New Member
  • Pip
  • 5 posts

Posted 20 August 2013 - 10:46 AM

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


Edited by Roger, 21 August 2013 - 07:50 AM.
title and tag

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download