Aug 16th, 2009, 03:35 PM
eclipseLink doesn't like transient entity manager
I am using Roo M2....set up a project and installed a jpa like so:
install jpa -provider ECLIPSELINK -dataBase MYSQL
then, ran "mvn test" and it seems that EclipeLink doesnt like the transient on:
transient javax.persistence.EntityManager Airport.entityManager;
so, I changed them all (in xxx_Roo_Entity.aj) to public (Using a text editor)...and, EclipseLink seems to be happier. Not withstanding other errors, which I will investigate.
Then, I restart Roo on the project and Roo, of course, changes them back to transient.
Is there a way to force the use of a qualifier, other than "transient" on this annotation?
Aug 17th, 2009, 04:51 AM
The transient field issue is known to cause problems with EclipseLink. I reported this back in February. You can vote on the ticket if you wish: https://bugs.eclipse.org/bugs/show_bug.cgi?id=264962
Aug 17th, 2009, 08:07 AM
Thank you for the response.
I have experimented and found that by putting the annotation and field definiton in the domain class allows an override. Placing :
public javax.persistence.EntityManager entityManager;
in the domain class causes Roo to use this definition.
Is this the preferred way of doing this?
Aug 17th, 2009, 07:20 PM
Well, omitting the transient keyword for the EntityManager would cause this field to be serialized - something that is definitely undesirable .
However, as luck would have it, the EclipseLink bug seems to have been addressed over night https://bugs.eclipse.org/bugs/show_bug.cgi?id=264962 . If you find the time, it would be nice if you could test it and see if it works now with the fixed version. Maybe EclipseLink releases nightly snapshots?
Aug 18th, 2009, 08:50 AM
thanks again....I'll have a look at it at some point.....it's funny that it calls it "mapping" metadata