Skip to content

Commit d057099

Browse files
committed
Add setter for defaultPersistenceUnitRootLocation
This commit adds a setter for the default persistence unit's defaultPersistenceUnitRootLocation attribute.
1 parent 411700d commit d057099

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@ public void setPersistenceUnitName(String persistenceUnitName) {
143143
this.internalPersistenceUnitManager.setDefaultPersistenceUnitName(persistenceUnitName);
144144
}
145145

146+
/**
147+
* Set the default persistence unit root location, to be applied
148+
* if no unit-specific persistence unit root could be determined.
149+
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
150+
* <p>Default is "classpath:", that is, the root of the current classpath
151+
* (nearest root directory). To be overridden if unit-specific resolution
152+
* does not work and the classpath root is not appropriate either.
153+
*/
154+
public void setDefaultPersistenceUnitRootLocation(String defaultPersistenceUnitRootLocation) {
155+
this.internalPersistenceUnitManager.setDefaultPersistenceUnitRootLocation(defaultPersistenceUnitRootLocation);
156+
}
157+
146158
/**
147159
* Set whether to use Spring-based scanning for entity classes in the classpath
148160
* instead of using JPA's standard scanning of jar files with {@code persistence.xml}

0 commit comments

Comments
 (0)