Skip to content

Commit 78049d3

Browse files
committed
Polishing
1 parent f4d45dd commit 78049d3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@
4343
* up a shared JPA EntityManagerFactory in a Spring application context;
4444
* the EntityManagerFactory can then be passed to JPA-based DAOs via
4545
* dependency injection. Note that switching to a JNDI lookup or to a
46-
* {@link LocalEntityManagerFactoryBean}
47-
* definition is just a matter of configuration!
46+
* {@link LocalEntityManagerFactoryBean} definition is just a matter of
47+
* configuration!
4848
*
4949
* <p>As with {@link LocalEntityManagerFactoryBean}, configuration settings
5050
* are usually read in from a {@code META-INF/persistence.xml} config file,
@@ -202,6 +202,7 @@ public void setMappingResources(String... mappingResources) {
202202
* Specify the JPA 2.0 shared cache mode for this persistence unit,
203203
* overriding a value in {@code persistence.xml} if set.
204204
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
205+
* @since 4.0
205206
* @see javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()
206207
* @see #setPersistenceUnitManager
207208
*/
@@ -213,6 +214,7 @@ public void setSharedCacheMode(SharedCacheMode sharedCacheMode) {
213214
* Specify the JPA 2.0 validation mode for this persistence unit,
214215
* overriding a value in {@code persistence.xml} if set.
215216
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
217+
* @since 4.0
216218
* @see javax.persistence.spi.PersistenceUnitInfo#getValidationMode()
217219
* @see #setPersistenceUnitManager
218220
*/
@@ -329,11 +331,6 @@ protected EntityManagerFactory createNativeEntityManagerFactory() throws Persist
329331
Class<?> providerClass = ClassUtils.resolveClassName(providerClassName, getBeanClassLoader());
330332
provider = (PersistenceProvider) BeanUtils.instantiateClass(providerClass);
331333
}
332-
if (provider == null) {
333-
throw new IllegalStateException("Unable to determine persistence provider. " +
334-
"Please check configuration of " + getClass().getName() + "; " +
335-
"ideally specify the appropriate JpaVendorAdapter class for this provider.");
336-
}
337334

338335
if (logger.isInfoEnabled()) {
339336
logger.info("Building JPA container EntityManagerFactory for persistence unit '" +

spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public void setMappingResources(String... mappingResources) {
261261
/**
262262
* Specify the JPA 2.0 shared cache mode for all of this manager's persistence
263263
* units, overriding any value in {@code persistence.xml} if set.
264+
* @since 4.0
264265
* @see javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()
265266
*/
266267
public void setSharedCacheMode(SharedCacheMode sharedCacheMode) {
@@ -270,6 +271,7 @@ public void setSharedCacheMode(SharedCacheMode sharedCacheMode) {
270271
/**
271272
* Specify the JPA 2.0 validation mode for all of this manager's persistence
272273
* units, overriding any value in {@code persistence.xml} if set.
274+
* @since 4.0
273275
* @see javax.persistence.spi.PersistenceUnitInfo#getValidationMode()
274276
*/
275277
public void setValidationMode(ValidationMode validationMode) {

0 commit comments

Comments
 (0)