diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java b/spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java index e9fbb6ce54..370638cbe9 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java @@ -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; * 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! * *
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 * Specify the JPA 2.0 shared cache mode for this persistence unit, * overriding a value in {@code persistence.xml} if set. *
NOTE: Only applied if no external PersistenceUnitManager specified. + * @since 4.0 * @see javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode() * @see #setPersistenceUnitManager */ @@ -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. *
NOTE: Only applied if no external PersistenceUnitManager specified. + * @since 4.0 * @see javax.persistence.spi.PersistenceUnitInfo#getValidationMode() * @see #setPersistenceUnitManager */ @@ -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 '" + diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java b/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java index 34ac4be069..bdd6f08c02 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java @@ -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 /** * 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) {