Browse Source

Polishing

pull/1155/head
Juergen Hoeller 8 years ago
parent
commit
78049d3d25
  1. 13
      spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java
  2. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -43,8 +43,8 @@ import org.springframework.util.ClassUtils; @@ -43,8 +43,8 @@ import org.springframework.util.ClassUtils;
* up a shared JPA EntityManagerFactory in a Spring application context;
* the EntityManagerFactory can then be passed to JPA-based DAOs via
* dependency injection. Note that switching to a JNDI lookup or to a
* {@link LocalEntityManagerFactoryBean}
* definition is just a matter of configuration!
* {@link LocalEntityManagerFactoryBean} definition is just a matter of
* configuration!
*
* <p>As with {@link LocalEntityManagerFactoryBean}, configuration settings
* are usually read in from a {@code META-INF/persistence.xml} config file,
@ -202,6 +202,7 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage @@ -202,6 +202,7 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
* Specify the JPA 2.0 shared cache mode for this persistence unit,
* overriding a value in {@code persistence.xml} if set.
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
* @since 4.0
* @see javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()
* @see #setPersistenceUnitManager
*/
@ -213,6 +214,7 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage @@ -213,6 +214,7 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
* Specify the JPA 2.0 validation mode for this persistence unit,
* overriding a value in {@code persistence.xml} if set.
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
* @since 4.0
* @see javax.persistence.spi.PersistenceUnitInfo#getValidationMode()
* @see #setPersistenceUnitManager
*/
@ -329,11 +331,6 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage @@ -329,11 +331,6 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
Class<?> providerClass = ClassUtils.resolveClassName(providerClassName, getBeanClassLoader());
provider = (PersistenceProvider) BeanUtils.instantiateClass(providerClass);
}
if (provider == null) {
throw new IllegalStateException("Unable to determine persistence provider. " +
"Please check configuration of " + getClass().getName() + "; " +
"ideally specify the appropriate JpaVendorAdapter class for this provider.");
}
if (logger.isInfoEnabled()) {
logger.info("Building JPA container EntityManagerFactory for persistence unit '" +

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

@ -261,6 +261,7 @@ public class DefaultPersistenceUnitManager @@ -261,6 +261,7 @@ public class DefaultPersistenceUnitManager
/**
* Specify the JPA 2.0 shared cache mode for all of this manager's persistence
* units, overriding any value in {@code persistence.xml} if set.
* @since 4.0
* @see javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()
*/
public void setSharedCacheMode(SharedCacheMode sharedCacheMode) {
@ -270,6 +271,7 @@ public class DefaultPersistenceUnitManager @@ -270,6 +271,7 @@ public class DefaultPersistenceUnitManager
/**
* Specify the JPA 2.0 validation mode for all of this manager's persistence
* units, overriding any value in {@code persistence.xml} if set.
* @since 4.0
* @see javax.persistence.spi.PersistenceUnitInfo#getValidationMode()
*/
public void setValidationMode(ValidationMode validationMode) {

Loading…
Cancel
Save