Add setter for defaultPersistenceUnitRootLocation

This commit adds a setter for the default persistence unit's
defaultPersistenceUnitRootLocation attribute.
This commit is contained in:
Stephane Nicoll 2016-08-17 17:40:58 +02:00
parent 022b013563
commit 1cad98dd31
1 changed files with 12 additions and 0 deletions

View File

@ -143,6 +143,18 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
this.internalPersistenceUnitManager.setDefaultPersistenceUnitName(persistenceUnitName);
}
/**
* Set the default persistence unit root location, to be applied
* if no unit-specific persistence unit root could be determined.
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
* <p>Default is "classpath:", that is, the root of the current classpath
* (nearest root directory). To be overridden if unit-specific resolution
* does not work and the classpath root is not appropriate either.
*/
public void setDefaultPersistenceUnitRootLocation(String defaultPersistenceUnitRootLocation) {
this.internalPersistenceUnitManager.setDefaultPersistenceUnitRootLocation(defaultPersistenceUnitRootLocation);
}
/**
* Set whether to use Spring-based scanning for entity classes in the classpath
* instead of using JPA's standard scanning of jar files with {@code persistence.xml}