Get your CodeRanch badge!*
The moose likes Object Relational Mapping and the fly likes Lazy loading issue with composite primary keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Lazy loading issue with composite primary keys" Watch "Lazy loading issue with composite primary keys" New topic
Author

Lazy loading issue with composite primary keys

Shimit Soumithran
Greenhorn

Joined: Dec 07, 2009
Posts: 1
Hello,

I have two entities Enterprise and EnterpriseGroupDefault. Enterprise is the parent entity. EnterpriseGroupDefault has composite primary keys. Its mapping is given below:

Now when I execute session.createQuery("from Enterprise") HQL, it executes successfully but it also fetches the child entity(EnterpriseGroupDefault), which I do not want to happen. Can anyone suggest what is going wrong here?

Thanks
Shimit
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Lazy loading issue with composite primary keys
 
Similar Threads
composite key, saving in two tables is giving NPE.
Multi-level Mapping
Foreig key must have same number of columns as the referenced primary key
Auto Generator in composite key
Use of set tag in Hibernate mapping file for foreign key