Category: hibernate

LocalContainerEntityManagerFactoryBean, Hibernate and superflous tables created in wrong database

TL;DRHibernate's (3.2-3.4) JPA implementation will pick up hbm files on it's own when it should be looking only at persistence.xml, thus:- loading more entities that it should- loading the wrong entities- performing schema updates in the wrong databaseThis one annoyed me plenty and took a great deal of debugging to sort out.The settingMy spring application … Continue reading LocalContainerEntityManagerFactoryBean, Hibernate and superflous tables created in wrong database

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)