I'm not exactly sure how this works for lazy-loadable properties that are
non-collection based objects, but I bet it's probably pretty similar. For properties
that are a collection implementation e.g. List, Set, .. etc., their lazy loaded proxy
collections implement the interface org.hibernate.collection.PersistentCollection after
they are persisted by the entity manager. To determine if one of these has been loaded
yet, you can call the wasInitialized() method. Most likely, the proxy objects that
implement lazy-loaded non-collection based properties implement a common interface and
have a method that you can call that is similar to wasInitialized().
I see that there is a org.hibernate.proxy.HibernateProxy interface. Perhaps these objects
implement that. If so, then you may be able to call
getHibernateLazyInitializer() to get a LazyInitializer and then from that call
isUninitialized(), how ever I have not yet tried this.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957200#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...