Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] CGLIB Proxy Using Wrapper Policy

Hi All,
  I would like further add - using custom one to one redirection policy, the
querying works fine but the insert/update/delete does not.

I think AbstractSession.getDescriptor needs to handle the CGLIB proxy or
this should mechanism to specify ProxyIndirectionPolicy policy. Is there any
currently which I am not aware of. (see the comment starting with GM below)
Currently AbstractSession only handles jdk dynamic proxy. Using CGLIB proxy
is possible to subclass the existing JPA entity directly without
implementing any interface. The advantage of proxy such way is many folds.

 public ClassDescriptor getDescriptor(Object domainObject) {
        if (domainObject == null) {
            return null;
        }
        //Bug#3947714  Check and trigger the proxy here
        if (this.project.hasProxyIndirection()) {
            return
getDescriptor(ProxyIndirectionPolicy.getValueFromProxy(domainObject).getClass());
            // GM
           // return
getDescriptor(CGLIBProxyIndirectionPolicy.getValueFromProxy(domainObject).getClass()); 
        }
        return getDescriptor(domainObject.getClass());
    }

Regards
GM
Oracle
-- 
View this message in context: http://old.nabble.com/CGLIB-Proxy-Using-Wrapper-Policy-tp28780712p28790579.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top