Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipselink and CGLib-enhanced entity types

This works by default in the native API, but in JPA a check was added to
ensure the object's class was correct.

You can disable this check by using a DescriptorCustomizer or
SessionCustomizer to set,

descriptor.getInheritancePolicy().setDescribesNonPersistentSubclasses(true);

However, please log a bug for this, as this setting should not be on
inheritance policy, as it must be supported for descriptors without
inheritance as well.  It should also be reconsidered to be disabled by
default, as CGLib and subclasses are quite common.



Olaf Otto wrote:
> 
> Hello eclipselink users,
> 
> I am wondering whether eclipselink supports entities that are proxied by 
> CGlib at runtime.
> I have the following situation: If certain entity classes are loaded 
> from the persistence layer, their instantiation strategy may proxy them 
> to support custom lazy-loading behavior (thats a long story, short). 
> After implementing this i realized that - not quite unexpected - 
> eclipselink could no longer retrieve the ClassDescriptor metadata for 
> the enhanced entity type, nor could modifications to instances of the 
> type be commited. Apparently, there are quite a number of 
> <entity>.getClass() == <x> checks and other direct usages of the entity 
> type in eclipselink which effectively prevent proxy usage.
> 
> Am i correct or is there a way to proxy entity types without these 
> sideeffects?
> 
> Best,
> Olaf
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Eclipselink-and-CGLib-enhanced-entity-types-tp23425522p23428531.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top