My current project is using JPA, heavily. JPA is a spec/standard/interface and I'm using the Hibernate implementation for it, but I import the entities from a different maven module. The entities module has a dependency on JPA, but not on Hibernate. So when I run my unit tests, I suddenly get a: java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable Openjpa? … Continue reading java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable
Tag: jpa
On JPA identifiers and business keys (or why business keys are a bad idea)
JPA, and for that matter Hibernate, depends on identifying entity instances (I'll refer to them as entities for short) by some key. That key can either be a single property (like a numeric ID column in the corresponding table) or a business key (also referred to as natural key). Business keys are entity properties which … Continue reading On JPA identifiers and business keys (or why business keys are a bad idea)
JPA and postgres transaction isolation
The short story: the default Postgres transaction isolation level can lead to trouble in a web application. I'm showing here a way to change it in a Spring/JPA application. The long story: One of the applications I worked recently on consists of a rich client which issues an HTTP request for every little thing it … Continue reading JPA and postgres transaction isolation