This content has been marked as final.
Show 3 replies
-
1. Re: Help:type of nodes returned by root.getNode() is unnarro
gmournos Oct 4, 2006 5:50 AM (in response to gmournos)Looking at the hibernate code, I can see that the last warning is probably irrelevant.
It is thrown by hibernate during a successful narrowing to warn that the new object instance breaks equality... -
2. Re: Help:type of nodes returned by root.getNode() is unnarro
gmournos Oct 9, 2006 9:02 AM (in response to gmournos)I needed to be able to look at the correct type nodes so I finally added an <any instead of a <many-to-one in the hibernate mappings for Token.
This solved my problem...In case someone has the same problem. -
3. Re: Help:type of nodes returned by root.getNode() is unnarro
gmournos Oct 20, 2006 12:37 PM (in response to gmournos)Actually I had the same problem when overriding other jbpm objects, so I finally wrote a method like this to get to the target object from the proxies...
public static Object narrowProxy(Object maybeProxy) { if (maybeProxy == null) throw new IllegalArgumentException("cannot narrow null"); if ( maybeProxy instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) maybeProxy; LazyInitializer li = proxy.getHibernateLazyInitializer(); return li.getImplementation(); //get the real object where the proxy is working on. //if the proxy is not initialized then it will be initialized here } else return maybeProxy; }
This code has more to do with hibernate, but if someone extends the Jbpm objects then it might be useful