users@glassfish.java.net

Re: EntityManagerWrapper.getDelegate() returning EntityManager?

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 21 Dec 2007 11:26:13 +0530

glassfish_at_javadesktop.org wrote:
> Not sure why it can't be fixed without waiting for the spec to change. After all, isn't the point of EntityManagerWrapper to just wrap the EntityManager to add some functionality and be otherwise transparent to the user? Or do you really need the spec to say "if you wrap an EntityManager in your own wrapper, make it so that the users don't have to be aware of that"? Isn't it kind of common sense?
>
+1
> Does anybody really expect EntityManager.getDelegate() to return another EntityManager instance? What for?
>
No, I don't expect EntityManager.getDelegate() to return yet another
EntityManager. If that was the intention, then the spec would have
specified the return type to be EntityManager instead of java.lang.Object.

More over, if getDelegate() was only supposed to be used for injected or
JNDI looked up entity managers, then why did the spec not mandate it to
throw an exception when used for application managed entity manager?

Thanks,
Sahoo
> [Message sent by forum member 'koser' (koser)]
>
> http://forums.java.net/jive/thread.jspa?messageID=251019
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>