1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2020 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.
@@ -193,8 +193,8 @@ public String getPersistenceUnitName() {
193
193
* {@code Persistence.createEntityManagerFactory} (if any).
194
194
* <p>Can be populated with a String "value" (parsed via PropertiesEditor) or a
195
195
* "props" element in XML bean definitions.
196
- * @see javax.persistence.Persistence#createEntityManagerFactory(String, java.util. Map)
197
- * @see javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory(javax.persistence.spi. PersistenceUnitInfo, java.util. Map)
196
+ * @see javax.persistence.Persistence#createEntityManagerFactory(String, Map)
197
+ * @see javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory(PersistenceUnitInfo, Map)
198
198
*/
199
199
public void setJpaProperties (Properties jpaProperties ) {
200
200
CollectionUtils .mergePropertiesIntoMap (jpaProperties , this .jpaPropertyMap );
@@ -204,8 +204,8 @@ public void setJpaProperties(Properties jpaProperties) {
204
204
* Specify JPA properties as a Map, to be passed into
205
205
* {@code Persistence.createEntityManagerFactory} (if any).
206
206
* <p>Can be populated with a "map" or "props" element in XML bean definitions.
207
- * @see javax.persistence.Persistence#createEntityManagerFactory(String, java.util. Map)
208
- * @see javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory(javax.persistence.spi. PersistenceUnitInfo, java.util. Map)
207
+ * @see javax.persistence.Persistence#createEntityManagerFactory(String, Map)
208
+ * @see javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory(PersistenceUnitInfo, Map)
209
209
*/
210
210
public void setJpaPropertyMap (@ Nullable Map <String , ?> jpaProperties ) {
211
211
if (jpaProperties != null ) {
@@ -400,10 +400,13 @@ private EntityManagerFactory buildNativeEntityManagerFactory() {
400
400
String message = ex .getMessage ();
401
401
String causeString = cause .toString ();
402
402
if (!message .endsWith (causeString )) {
403
- throw new PersistenceException (message + "; nested exception is " + causeString , cause );
403
+ ex = new PersistenceException (message + "; nested exception is " + causeString , cause );
404
404
}
405
405
}
406
406
}
407
+ if (logger .isErrorEnabled ()) {
408
+ logger .error ("Failed to initialize JPA EntityManagerFactory: " + ex .getMessage ());
409
+ }
407
410
throw ex ;
408
411
}
409
412
0 commit comments