tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1414434 - /openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java
Date Tue, 27 Nov 2012 22:15:39 GMT
Author: rmannibucau
Date: Tue Nov 27 22:15:38 2012
New Revision: 1414434

URL: http://svn.apache.org/viewvc?rev=1414434&view=rev
Log:
TOMEE-611 no need of validatorfactory when no validation are done by the emf

Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java?rev=1414434&r1=1414433&r2=1414434&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java
Tue Nov 27 22:15:38 2012
@@ -20,6 +20,7 @@ import org.apache.openejb.loader.SystemI
 import org.apache.openejb.persistence.PersistenceUnitInfoImpl;
 
 import javax.persistence.EntityManagerFactory;
+import javax.persistence.ValidationMode;
 import javax.persistence.spi.PersistenceProvider;
 import java.util.HashMap;
 import java.util.Map;
@@ -48,7 +49,9 @@ public class EntityManagerFactoryCallabl
 
             // Create entity manager factories with the validator factory
             final Map<String, Object> properties = new HashMap<String, Object>();
-            properties.put("javax.persistence.validator.ValidatorFactory", new ValidatorFactoryWrapper());
+            if (!ValidationMode.NONE.equals(unitInfo.getValidationMode())) {
+                properties.put("javax.persistence.validator.ValidatorFactory", new ValidatorFactoryWrapper());
+            }
             EntityManagerFactory emf = persistenceProvider.createContainerEntityManagerFactory(unitInfo,
properties);
 
             if ((unitInfo.getProperties() != null



Mime
View raw message