-->
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.  [ 2 posts ] 
Author Message
 Post subject: Can I Map Same Table to 2 Objects? Here's why...
PostPosted: Sat Jul 08, 2006 4:03 pm 
Newbie

Joined: Fri Jul 07, 2006 1:30 pm
Posts: 6
Hibernate version: 3.1.1

I want to control in different cases whether Hibernate lazy loads a List member of an object or not. So can't do it in mapping.xml because it only configures it for the object and not for different transactions.

Can I map two similar objects to the same table. Both have same field properties and both have a List representing child objects. The only difference would be 1 object has the List set to Not lazy load, and the other has the List set to lazy load.

Doing it this way I could control the lazy loading by deciding which Object to use.

Would this work? I have not found another way to customize lazy loading at each different transaction level. This could be a cool workaround.

Comments please?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 4:51 pm 
Beginner
Beginner

Joined: Thu Oct 16, 2003 7:25 pm
Posts: 38
Location: New York City
You could simply reference the list member in the transactions that need them, and leave them lazy. Or, are you trying to deal with all your POJOs in a generic way?


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

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.