Thread:
 force initialization 
 jkookie   07 Jul 2006, 13:03 
 Re: force initialization 
 motravo   07 Aug 2006, 00:59 
 Re: force initialization 
 motravo   07 Aug 2006, 01:36 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: jkookie (07 Jul 2006, 13:03) Replies: 2, Views: 25939
Subject: force initialization
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.
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]