A beginner’s guide to JPA persistence.xml file

Introduction In this article, I’m going to explain what is the purpose of the JPA persistence.xml configuration file, and how you can set up a Java Persistence application using the available XML tags or attributes. While Spring applications can bootstrap without needing an XML JPA configuration file, it’s still important to understand the meaning of each configuration option since Spring also offers an alternative way when building a Java Persistence LocalContainerEntityManagerFactoryBean or the Hibernate-specific LocalSessionFactoryBean.

How to use external XML mappings files (outside of JAR) with JPA and Hibernate

Introduction Flemming Harms has asked a very good question on Twitter: Basically, we want to move the JPA XML mappings outside of the application JAR so that we can change the mapping without affecting the jar file.