Everyone I know who's moved from Hibernate to OpenJPA agrees that enhancement is a major nuisance in OpenJPA.

I'm spending valuable time explaining to my team why this is needed, which of all the warning messages can be ignored and which are real problems, and why we didn't simply stick with Hibernate (answer: because Hibernate sucks on persistent maps).

Enhancement is a violation of the KISS principle. Hibernate just works out of the box, and you don't have to worry about enhancement or weaving at all.

I really think the onus is on OpenJPA: Why should users have to learn about extra build steps when they could do without?

The most manifest problem with build-time enhancment is that it makes your entity JAR depend on OpenJPA. This is a no-go when you use (parts of) your entity model with different JPA providers.



Can you please elaborate why you did not prefer *build-time enhancement*?

build-time enhancement is
a) a simple post-compilation step

Yes, but it makes your classes depend on OpenJPA.

b) easily integrable to any automated Ant/Maven based build environment

This does not cover IDEs like Eclipse + Maven + m2e + WTP where any postprocessing of class files just breaks the toolchain.

c) saves a ton of trouble

Funny - enhancement is really the one major _source_ of trouble I've had with OpenJPA since I started using it a year ago, and I'd really love to see it disappear.


But it is not as popular as we would like it to be.
I am just trying to understand why.


Because it forces you to worry about things you don't want to know about.

Deployment time enhancement at least works on Glassfish 3.1 or on OSGi with Equinox 3.7 with Aries 0.4-SNAPSHOT, but then you still have to worry about enhancement for out-of-container tests.

And my project uses Spring and Tomcat (which are not so easy to get rid of) where load time enhancement just doesn't work at all for some reason, at least not with our fairly complex entity model.

Best regards,

Harald




Reply via email to