From 0c18c38a55071e26857290361c918f781e59b6c6 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Sun, 11 Mar 2012 02:29:19 +0100 Subject: [PATCH] METAGEN-82 Fixed a few inconsistencies in the way @MappedSuperClass are considered --- .../jpamodelgen/JPAMetaModelEntityProcessor.java | 6 +++--- .../java/org/hibernate/jpamodelgen/xml/XmlParser.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java index 6c9cbd06b9..e7e75cef45 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java @@ -259,11 +259,11 @@ public class JPAMetaModelEntityProcessor extends AbstractProcessor { private MetaEntity tryGettingExistingEntityFromContext(AnnotationMirror mirror, String fqn) { MetaEntity alreadyExistingMetaEntity = null; - if ( TypeUtils.isAnnotationMirrorOfType( mirror, Constants.ENTITY ) ) { + if ( TypeUtils.isAnnotationMirrorOfType( mirror, Constants.ENTITY ) + || TypeUtils.isAnnotationMirrorOfType( mirror, Constants.MAPPED_SUPERCLASS )) { alreadyExistingMetaEntity = context.getMetaEntity( fqn ); } - else if ( TypeUtils.isAnnotationMirrorOfType( mirror, Constants.MAPPED_SUPERCLASS ) - || TypeUtils.isAnnotationMirrorOfType( mirror, Constants.EMBEDDABLE ) ) { + else if ( TypeUtils.isAnnotationMirrorOfType( mirror, Constants.EMBEDDABLE ) ) { alreadyExistingMetaEntity = context.getMetaEmbeddable( fqn ); } return alreadyExistingMetaEntity; diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/XmlParser.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/XmlParser.java index eaa6ea89d3..4a10c09abb 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/XmlParser.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/XmlParser.java @@ -219,7 +219,7 @@ public class XmlParser { if ( context.containsMetaEntity( fqcn ) ) { context.logMessage( Diagnostic.Kind.WARNING, - fqcn + " was already processed once. Skipping second occurance." + fqcn + " was already processed once. Skipping second occurrence." ); } context.addMetaEntity( fqcn, metaEntity ); @@ -244,7 +244,7 @@ public class XmlParser { if ( context.containsMetaEmbeddable( fqcn ) ) { context.logMessage( Diagnostic.Kind.WARNING, - fqcn + " was already processed once. Skipping second occurance." + fqcn + " was already processed once. Skipping second occurrence." ); } context.addMetaEmbeddable( fqcn, metaEntity ); @@ -271,10 +271,10 @@ public class XmlParser { mappedSuperClass, pkg, getXmlMappedType( fqcn ), context ); - if ( context.containsMetaEmbeddable( fqcn ) ) { + if ( context.containsMetaEntity( fqcn ) ) { context.logMessage( Diagnostic.Kind.WARNING, - fqcn + " was already processed once. Skipping second occurance." + fqcn + " was already processed once. Skipping second occurrence." ); } context.addMetaEntity( fqcn, metaEntity );