cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r572149 - /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
Date Sun, 02 Sep 2007 20:51:53 GMT
Author: aadamchik
Date: Sun Sep  2 13:51:53 2007
New Revision: 572149

URL: http://svn.apache.org/viewvc?rev=572149&view=rev
Log:
respecting 'excludeUnlistedClasses' prop

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java?rev=572149&r1=572148&r2=572149&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
Sun Sep  2 13:51:53 2007
@@ -211,25 +211,27 @@
         }
 
         // now detect potential managed classes from PU root and extra jars
-        Collection<String> implicitClasses = listImplicitClasses(persistenceUnit);
-        for (String className : implicitClasses) {
+        if (!persistenceUnit.excludeUnlistedClasses()) {
+            Collection<String> implicitClasses = listImplicitClasses(persistenceUnit);
+            for (String className : implicitClasses) {
 
-            if (managedClassMap.containsKey(className)) {
-                continue;
-            }
+                if (managedClassMap.containsKey(className)) {
+                    continue;
+                }
 
-            Class managedClass;
-            try {
-                managedClass = Class.forName(className, true, loader);
-            }
-            catch (ClassNotFoundException e) {
-                throw new JpaProviderException("Class not found: " + className, e);
-            }
+                Class managedClass;
+                try {
+                    managedClass = Class.forName(className, true, loader);
+                }
+                catch (ClassNotFoundException e) {
+                    throw new JpaProviderException("Class not found: " + className, e);
+                }
 
-            if (managedClass.getAnnotation(Entity.class) != null
-                    || managedClass.getAnnotation(MappedSuperclass.class) != null
-                    || managedClass.getAnnotation(Embeddable.class) != null) {
-                managedClassMap.put(className, managedClass);
+                if (managedClass.getAnnotation(Entity.class) != null
+                        || managedClass.getAnnotation(MappedSuperclass.class) != null
+                        || managedClass.getAnnotation(Embeddable.class) != null) {
+                    managedClassMap.put(className, managedClass);
+                }
             }
         }
 



Mime
View raw message