From 31c47a6c04a3c7d024ccd1318ca06e7696c222e8 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Tue, 15 Apr 2008 15:12:11 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@648275 13f79535-47bb-0310-9956-ffa450edef68 --- .../persistence/AnnotationPersistenceMetaDataParser.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java index ab6233dbe..f98f7ec43 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java @@ -534,20 +534,20 @@ public class AnnotationPersistenceMetaDataParser 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: