Can't polymorphic classes and CGLIB be handled with the static
initialize method e.g
public void forceInitializeProxy(Object o) {
if(!Hibernate.isInitialized(o)){
Hibernate.initialize(o);
}
}
I thought the initialize method's function was to explicitly
initialize the proxy. So now if i retrieved an object using hibernate
and then forceinitialize it using the above method, would i then be
able to use 'instance of' (I know it's bad form, and i already have
the visitor pattern implemented) to distinguish between different
subclasses of the object retrieved?
I'm just trying to understand if the initialize method does what i
think it does. Thank you in advance. |