users@glassfish.java.net

EntityManagerWrapper.getDelegate() returning EntityManager?

From: <glassfish_at_javadesktop.org>
Date: Thu, 20 Dec 2007 02:26:44 PST

Hi,

why does EntityManagerWrapper.getDelegate() return the wrapped EntityManager instead of the wrapped EntityManager's getDelegate()? This means that my code using EntityManager and accessing the underlying delegate (Hibernate Session in my case) has to account for this oddity. Is this really correct?

The javadoc for EntityManager#getDelegate says "Return the underlying provider object for the EntityManager, if available" which I kind of understand as meaning that getDelegate() should give me back Session if I'm using Hibernate, no matter what the EM is wrapped inside. Can someone clarify?

I'm using Glassfish v2-b58g.

Thanks
[Message sent by forum member 'koser' (koser)]

http://forums.java.net/jive/thread.jspa?messageID=250923