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 );