-->
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: Is Lazy Collection
PostPosted: Thu Apr 12, 2007 9:47 pm 
Newbie

Joined: Tue Sep 21, 2004 1:33 pm
Posts: 5
Is there an easy way to determine if a collection in a Class is marked as lazy loaded in hibernate?

In other words I want to use reflection to get all declared Field objects of a class and determine if a Collection is an instance of AbstractPersistentCollection or is a Collection that will be lazily loaded via hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 19, 2007 5:14 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,
Hibernate Model is a POJO, and for the same reason I don't think it is possible to get that information straight away.
However,If you are using Hibernate annotations to define the mappings,
then,
you can do getDeclaredAnnotations() for your collection field ( using Reflection ) and see if it has @LazyCollection or has @ManyToMany(fetch=FetchType.LAZY) annotation

----------------------------------------------------
Rate the answer if you find it helpful


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.