• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help required on hibernate QBE

 
dipak mehta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a Set of DetailsObject in MasterObject.

MasterObject maps to a "Master" table and DetailsObject maps to a "Details" table which have Master.ID as foreign key.

Now I want to query whether MasterObject exist in database or not. But it should compare all the DetailsObject from the Set also in the detail table.

I tried like this...

List list = session.createCriteria(MasterObject.class)
.add(Example.create(masterObject))
.list();

this actually queries only for masterObject and didn't compare the DetailsObject which is there as a Set (Collection) ???

is there any way so that all the objects of DetailsObject from Set also gets compared ???
 
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
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!