Author: mprudhom
Date: Sun Sep 17 11:52:37 2006
New Revision: 447112
URL: http://svn.apache.org/viewvc?view=rev&rev=447112
Log:
Use the environment class loader as the metadata loader only if it is not null.
Modified:
incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
Modified:
incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java?view=diff&rev=447112&r1=447111&r2=447112
==============================================================================
---
incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
(original)
+++
incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
Sun Sep 17 11:52:37 2006
@@ -232,7 +232,7 @@
ClassLoader loader = repos.getConfiguration().
getClassResolverInstance().getClassLoader(cls, envLoader);
XMLPersistenceMetaDataParser xmlParser = getXMLParser();
- xmlParser.setClassLoader(envLoader);
+ xmlParser.setClassLoader(envLoader != null ? envLoader : loader);
xmlParser.setEnvClassLoader(envLoader);
xmlParser.setMode(mode);
try {
@@ -276,15 +276,16 @@
(queryName, (NamedQuery) cls.getAnnotation(NamedQuery.class)))
return cls;
if (cls.isAnnotationPresent(NamedQueries.class) &&
- hasNamedQuery(queryName, ((NamedQueries) cls.getAnnotation
- (NamedQueries.class)).value()))
+ hasNamedQuery(queryName, ((NamedQueries) cls.
+ getAnnotation(NamedQueries.class)).value()))
return cls;
- if (cls.isAnnotationPresent(NamedNativeQuery.class) &&
hasNamedNativeQuery
- (queryName, (NamedNativeQuery)
cls.getAnnotation(NamedNativeQuery.class)))
+ if (cls.isAnnotationPresent(NamedNativeQuery.class) &&
+ hasNamedNativeQuery(queryName, (NamedNativeQuery) cls.
+ getAnnotation(NamedNativeQuery.class)))
return cls;
if (cls.isAnnotationPresent(NamedNativeQueries.class) &&
- hasNamedNativeQuery(queryName, ((NamedNativeQueries)
cls.getAnnotation
- (NamedNativeQueries.class)).value()))
+ hasNamedNativeQuery(queryName, ((NamedNativeQueries) cls.
+ getAnnotation(NamedNativeQueries.class)).value()))
return cls;
}
return null;