java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable

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

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)