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: