openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r648275 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
Date Tue, 15 Apr 2008 15:12:13 GMT
Author: allee8285
Date: Tue Apr 15 08:12:11 2008
New Revision: 648275

URL: http://svn.apache.org/viewvc?rev=648275&view=rev
Log:
OPENJPA-570 - Model after the AnnotationPersistenceMetaDataParser.parsePackageAnnotations(),
an extra test is performed in parseClassAnnotations() method for the Named*Quer* annotations
to see if the MODE_QUERY has been performed before by examining the meta.getSourceMode() before
the actualNamed*Queries() method is invoked.

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=648275&r1=648274&r2=648275&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
Tue Apr 15 08:12:11 2008
@@ -534,20 +534,20 @@
                         meta.setObjectIdType(((IdClass) anno).value(), true);
                     break;
                 case NATIVE_QUERIES:
-                    if (isQueryMode())
+                    if (isQueryMode() && (meta.getSourceMode() & MODE_QUERY)
== 0)
                         parseNamedNativeQueries(_cls,
                             ((NamedNativeQueries) anno).value());
                     break;
                 case NATIVE_QUERY:
-                    if (isQueryMode())
+                    if (isQueryMode() && (meta.getSourceMode() & MODE_QUERY)
== 0)
                         parseNamedNativeQueries(_cls, (NamedNativeQuery) anno);
                     break;
                 case QUERIES:
-                    if (isQueryMode())
+                    if (isQueryMode() && (meta.getSourceMode() & MODE_QUERY)
== 0)
                         parseNamedQueries(_cls, ((NamedQueries) anno).value());
                     break;
                 case QUERY:
-                    if (isQueryMode())
+                    if (isQueryMode() && (meta.getSourceMode() & MODE_QUERY)
== 0)
                         parseNamedQueries(_cls, (NamedQuery) anno);
                     break;
                 case SEQ_GENERATOR:



Mime
View raw message