-->
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: Extra Lazy Collections plug compatible with LazyCollections?
PostPosted: Tue Jun 19, 2012 10:04 am 
Regular
Regular

Joined: Wed Jan 21, 2009 8:41 pm
Posts: 54
I've had to abandon plans to use Extra Lazy Collections for the following reasons.

We have use cases where when we check for the existence of an object we are comparing equality based on natural identifiers using contains and equals. So with a one to many relationship you iterate and use contains on the collection to check if you've already seen the object your currently processing and it's already been inserted.

This works fine with a Lazy collection however with Extra Lazy Collections this doesn't work at all when you're using sequences for the actual primary keys of these objects. This is because obviously when you're comparing an object that has no identified to one that does the implementation of contains on a Extra Lazy Collection uses the actual columns associated with the join relationship b/w the two entities and to complete such a join you use the sequences as the values. Sequences are simply not known when all you have is the natural identifier state to make your comparison.

So you're forced to incur the initialization of the collection just to check existence.

Therefore Extra Lazy Collections simply cannot always replace Lazy Collections and seem to only be applicable when you identifiers are based on natural keys.


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.