Interestingly, Hibernate has similar behavior but little better in the sense
that it at least calls the overridden accessors.
https://forum.hibernate.org/viewtopic.php?f=1t=998837
Can this be fixed?
--
View this message in context:
Can someone help please?
--
View this message in context:
http://n2.nabble.com/overriding-accesors-in-entity-need-tranisent-declaration-tp3363414p3386510.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Digging further into this, there is a major difference in the way the entity
class is instantiated by EciplseLink versus OpenJPA.
When using eclipselink w/o the transient declaration, the entity class's
overridden setters are called (which in turn call super).
While using OpenJPA with transient
Moving the mysql driver from 5.0.7 to 5.1.8 resolved this issue. Thanks!
But now I have hit the next and more serious hurdle but I will post that as
a new question.
--
View this message in context:
The orm.xml looks like this,
accessPROPERTY/access
mapped-superclass class=UserModelBaseImpl
attributes
id name=id
generated-value strategy=IDENTITY/
/id
basic name=name
column name=firstName /
Sorry to continue to compare with EclipseLink but the application is working
just fine on TopLink/EclipseLink and I am trying to get it to work with
OpenJPA. The
http://n2.nabble.com/enhancing-entity-which-is-a-subclass-tp612p612.html
first problem was resolved by Rick (thanks!) and
Thanks a lot Rick. It worked!
Rick Curtis wrote:
After looking at the spec, it looks like you should be using the
mapped-superclass XML descriptor on the UserModelBaseImpl class and
com.example.model.impl.UserModelImpl needs to be added to your list of
persistent classes. See section
Everything works with EclipseLink and TopLink but fails with OpenJPA.
Tried with runtime as well as build time enhancement. The problem is the
entity class is a subclass. In this test case, it is an empty class which
inherits everything from the base class UserModelBaseImpl.
...
...
...
Here are the relevant snippets.
persistence.xml fragment
-
persistence-unit name=UserAdmin transaction-type=RESOURCE_LOCAL
!-- Explicitly define mapping file path, else Hibernate won't find the
default --
non-jta-data-source/