One of the top problem with JPA configuration is the inability to provide a true modular configuration of an application’s persistence unit. The persistence unit declares the entities that are to be included for a particular JPA-compliant implementation like Hibernate. The problem in practice is that it is forbidden to link entities if they are placed in two different persistence units so a single persistence unit, defined at the application level must be used. This single configuration file needs to declare the entities and/or the list of JAR files to be scanned in the application and it needs to be aware of all the modules that are used by the application (that is, it cannot update itself based on the available modules). This blog entry explains how this issue can be circumvented using Spring. A sample showcase project is also attached. [...]