1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
43
43
* up a shared JPA EntityManagerFactory in a Spring application context;
44
44
* the EntityManagerFactory can then be passed to JPA-based DAOs via
45
45
* 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!
48
48
*
49
49
* <p>As with {@link LocalEntityManagerFactoryBean}, configuration settings
50
50
* are usually read in from a {@code META-INF/persistence.xml} config file,
@@ -202,6 +202,7 @@ public void setMappingResources(String... mappingResources) {
202
202
* Specify the JPA 2.0 shared cache mode for this persistence unit,
203
203
* overriding a value in {@code persistence.xml} if set.
204
204
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
205
+ * @since 4.0
205
206
* @see javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()
206
207
* @see #setPersistenceUnitManager
207
208
*/
@@ -213,6 +214,7 @@ public void setSharedCacheMode(SharedCacheMode sharedCacheMode) {
213
214
* Specify the JPA 2.0 validation mode for this persistence unit,
214
215
* overriding a value in {@code persistence.xml} if set.
215
216
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
217
+ * @since 4.0
216
218
* @see javax.persistence.spi.PersistenceUnitInfo#getValidationMode()
217
219
* @see #setPersistenceUnitManager
218
220
*/
@@ -329,11 +331,6 @@ protected EntityManagerFactory createNativeEntityManagerFactory() throws Persist
329
331
Class <?> providerClass = ClassUtils .resolveClassName (providerClassName , getBeanClassLoader ());
330
332
provider = (PersistenceProvider ) BeanUtils .instantiateClass (providerClass );
331
333
}
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
- }
337
334
338
335
if (logger .isInfoEnabled ()) {
339
336
logger .info ("Building JPA container EntityManagerFactory for persistence unit '" +
0 commit comments