openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1627059 - in /openjpa/branches/2.2.x: ./ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
Date Tue, 23 Sep 2014 15:35:54 GMT
Author: hthomann
Date: Tue Sep 23 15:35:53 2014
New Revision: 1627059

URL: http://svn.apache.org/r1627059
Log:
OPENJPA-2505: Properly init MetaDataRepository when obtaining a reference in EntityManagerFactory.getMetaModel.
 Back-ported to 2.2.x Rick Curtis' trunk changes.

Added:
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/
      - copied from r1626287, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/AddressEntity.java
      - copied unchanged from r1626287, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/AddressEntity.java
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/AddressPk.java
      - copied unchanged from r1626287, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/AddressPk.java
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/MyUserEntity.java
      - copied unchanged from r1626287, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/MyUserEntity.java
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/TestCriteriaInitialization.java
      - copied unchanged from r1626287, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/init/TestCriteriaInitialization.java
Modified:
    openjpa/branches/2.2.x/   (props changed)
    openjpa/branches/2.2.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java

Propchange: openjpa/branches/2.2.x/
------------------------------------------------------------------------------
  Merged /openjpa/trunk:r1626287

Modified: openjpa/branches/2.2.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=1627059&r1=1627058&r2=1627059&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
(original)
+++ openjpa/branches/2.2.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
Tue Sep 23 15:35:53 2014
@@ -43,6 +43,7 @@ import org.apache.openjpa.lib.conf.Value
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Closeable;
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.meta.MetaDataRepository;
 import org.apache.openjpa.persistence.criteria.CriteriaBuilderImpl;
 import org.apache.openjpa.persistence.criteria.OpenJPACriteriaBuilder;
 import org.apache.openjpa.persistence.meta.MetamodelImpl;
@@ -343,8 +344,10 @@ public class EntityManagerFactoryImpl
 
     public MetamodelImpl getMetamodel() {
         if (_metaModel == null) {
-            _metaModel = new MetamodelImpl(getConfiguration()
-                .getMetaDataRepositoryInstance());
+            MetaDataRepository mdr = getConfiguration().getMetaDataRepositoryInstance();
+            mdr.setValidate(MetaDataRepository.VALIDATE_RUNTIME, true);
+            mdr.setResolve(MetaDataRepository.MODE_MAPPING_INIT, true);
+            _metaModel = new MetamodelImpl(mdr);
         }
         return _metaModel;
     }



Mime
View raw message