openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yawn, Mike" <>
Subject Curious about subclassing rather than entity enhancement
Date Mon, 27 Jul 2009 15:45:48 GMT

I'm curious about something I read on the 'Entity Enhancement' page.
Currently, our "JPA-like" implementation of annotations uses the
standard JPA annotations, but on an interface rather than a class.
Then, our code generation generates the implementation classes from the
interface; we don't ever add or modify code behind the user's back, so
all the implementation code is fully visible.


On the entity enhancement page, there is a statement that "Some JPA
providers auto-generate new subclasses or proxy objects that front the
user's Entity objects at runtime" ...., and I'm curious how this works
given that it seems that the mechanism for creating an entity object is
to call "new" on it.   So, if there is a JPA-annotated class that
represents the entity, and then a JPA implementer creates a subclass of
this to provide loaded / dirty tracking, etc., it seems that any
instantiation of the Entity via "new"  would be getting the annotated
base class, not the subclass with the implementation of these features.
How is that being handled in JPA implementations that use subclasses
rather than byte-code weaving ?




Mike Yawn

eBay Inc.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message