diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index 902966d970..d41bd047d8 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -87,7 +87,7 @@ task jaxb { // hibernate-configuration ant.xjc( destdir: '${jaxbTargetDir}', - package: 'org.hibernate.metamodel.source.hbm.jaxb.config', + package: 'org.hibernate.internal.jaxb.cfg', binding: 'src/main/xjb/hbm-configuration-bindings.xjb', schema: cfgXsd.path ) @@ -95,7 +95,7 @@ task jaxb { // hibernate-mapping ant.xjc( destdir: '${jaxbTargetDir}', - package: 'org.hibernate.metamodel.source.hbm.jaxb.mapping', + package: 'org.hibernate.internal.jaxb.mapping.hbm', binding: hbmXjb.path, schema: hbmXsd.path, extension: 'true' @@ -106,7 +106,7 @@ task jaxb { // orm.xml (jpa) ant.xjc( destdir: '${jaxbTargetDir}', - package: 'org.hibernate.metamodel.source.annotation.jaxb', + package: 'org.hibernate.internal.jaxb.mapping.orm', binding: 'src/main/xjb/orm-bindings.xjb', schema: ormXsd.path ) diff --git a/hibernate-core/src/main/java/org/hibernate/InvalidMappingException.java b/hibernate-core/src/main/java/org/hibernate/InvalidMappingException.java index afee84203c..a5580bcb1b 100644 --- a/hibernate-core/src/main/java/org/hibernate/InvalidMappingException.java +++ b/hibernate-core/src/main/java/org/hibernate/InvalidMappingException.java @@ -23,8 +23,8 @@ */ package org.hibernate; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.internal.util.xml.XmlDocument; -import org.hibernate.metamodel.source.Origin; /** * Thrown when a mapping is found to be invalid. diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbRoot.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/JaxbRoot.java similarity index 94% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbRoot.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/JaxbRoot.java index 888b05aecb..918f034d5c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbRoot.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/JaxbRoot.java @@ -21,9 +21,9 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.internal; +package org.hibernate.internal.jaxb; -import org.hibernate.metamodel.source.Origin; +import org.hibernate.internal.jaxb.Origin; /** * Holds information about a JAXB-unmarshalled XML document. diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/Origin.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/Origin.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/Origin.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/Origin.java index 824d433bd8..c596537f8b 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/Origin.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/Origin.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source; +package org.hibernate.internal.jaxb; import java.io.Serializable; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/SourceType.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/SourceType.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/SourceType.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/SourceType.java index 461890f51d..32245a3eaa 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/SourceType.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/SourceType.java @@ -22,10 +22,10 @@ * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source; +package org.hibernate.internal.jaxb; /** - * From where did the metadata come from? + * From what type of source did we obtain the data * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/CustomSqlElement.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/CustomSqlElement.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/CustomSqlElement.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/CustomSqlElement.java index 14d850d044..5213c84d36 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/CustomSqlElement.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/CustomSqlElement.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; /** * @author Steve Ebersole @@ -29,5 +29,5 @@ package org.hibernate.metamodel.source.hbm.jaxb.mapping; public interface CustomSqlElement { public String getValue(); public boolean isCallable(); - public XMLCheckAttribute getCheck(); + public JaxbCheckAttribute getCheck(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/EntityElement.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/EntityElement.java similarity index 78% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/EntityElement.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/EntityElement.java index efe6ec4e75..a0280bc69c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/EntityElement.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/EntityElement.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; import java.util.List; @@ -40,19 +40,19 @@ public interface EntityElement extends MetaAttributeContainer { public boolean isDynamicUpdate(); public boolean isSelectBeforeUpdate(); - public List getTuplizer(); + public List getTuplizer(); public String getPersister(); - public XMLLoaderElement getLoader(); - public XMLSqlInsertElement getSqlInsert(); - public XMLSqlUpdateElement getSqlUpdate(); - public XMLSqlDeleteElement getSqlDelete(); + public JaxbLoaderElement getLoader(); + public JaxbSqlInsertElement getSqlInsert(); + public JaxbSqlUpdateElement getSqlUpdate(); + public JaxbSqlDeleteElement getSqlDelete(); - public List getSynchronize(); + public List getSynchronize(); - public List getFetchProfile(); + public List getFetchProfile(); - public List getResultset(); + public List getResultset(); public List getQueryOrSqlQuery(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/IdBagPluralAttributeElementAdapter.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/IdBagPluralAttributeElementAdapter.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/IdBagPluralAttributeElementAdapter.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/IdBagPluralAttributeElementAdapter.java index b7589a0428..fad92698bb 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/IdBagPluralAttributeElementAdapter.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/IdBagPluralAttributeElementAdapter.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; /** * Adaptive implementation of the {@link PluralAttributeElement} for {@code } mappings which @@ -30,7 +30,7 @@ package org.hibernate.metamodel.source.hbm.jaxb.mapping; * @author Steve Ebersole */ public abstract class IdBagPluralAttributeElementAdapter implements PluralAttributeElement { - public XMLOneToManyElement getOneToMany() { + public JaxbOneToManyElement getOneToMany() { // idbag collections cannot contain 1-m mappings. return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/JoinElementSource.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/JoinElementSource.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/JoinElementSource.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/JoinElementSource.java index f5f5d2cd48..4ff687415d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/JoinElementSource.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/JoinElementSource.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; import java.util.List; @@ -29,5 +29,5 @@ import java.util.List; * @author Steve Ebersole */ public interface JoinElementSource { - public List getJoin(); + public List getJoin(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/MetaAttributeContainer.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/MetaAttributeContainer.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/MetaAttributeContainer.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/MetaAttributeContainer.java index 6da5521d4d..6a178cb8f0 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/MetaAttributeContainer.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/MetaAttributeContainer.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; import java.util.List; @@ -29,5 +29,5 @@ import java.util.List; * @author Steve Ebersole */ public interface MetaAttributeContainer { - public List getMeta(); + public List getMeta(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/PluralAttributeElement.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/PluralAttributeElement.java similarity index 70% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/PluralAttributeElement.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/PluralAttributeElement.java index 6eb46ccea1..adf766fbe0 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/PluralAttributeElement.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/PluralAttributeElement.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; import java.util.List; @@ -34,13 +34,13 @@ public interface PluralAttributeElement extends MetaAttributeContainer { public String getName(); public String getAccess(); - public XMLKeyElement getKey(); + public JaxbKeyElement getKey(); - public XMLElementElement getElement(); - public XMLCompositeElementElement getCompositeElement(); - public XMLOneToManyElement getOneToMany(); - public XMLManyToManyElement getManyToMany(); - public XMLManyToAnyElement getManyToAny(); + public JaxbElementElement getElement(); + public JaxbCompositeElementElement getCompositeElement(); + public JaxbOneToManyElement getOneToMany(); + public JaxbManyToManyElement getManyToMany(); + public JaxbManyToAnyElement getManyToAny(); public String getSchema(); public String getCatalog(); @@ -51,21 +51,21 @@ public interface PluralAttributeElement extends MetaAttributeContainer { public String getSubselectAttribute(); public String getWhere(); - public XMLLoaderElement getLoader(); - public XMLSqlInsertElement getSqlInsert(); - public XMLSqlUpdateElement getSqlUpdate(); - public XMLSqlDeleteElement getSqlDelete(); - public XMLSqlDeleteAllElement getSqlDeleteAll(); + public JaxbLoaderElement getLoader(); + public JaxbSqlInsertElement getSqlInsert(); + public JaxbSqlUpdateElement getSqlUpdate(); + public JaxbSqlDeleteElement getSqlDelete(); + public JaxbSqlDeleteAllElement getSqlDeleteAll(); - public List getSynchronize(); + public List getSynchronize(); - public XMLCacheElement getCache(); - public List getFilter(); + public JaxbCacheElement getCache(); + public List getFilter(); public String getCascade(); - public XMLFetchAttributeWithSubselect getFetch(); - public XMLLazyAttributeWithExtra getLazy(); - public XMLOuterJoinAttribute getOuterJoin(); + public JaxbFetchAttributeWithSubselect getFetch(); + public JaxbLazyAttributeWithExtra getLazy(); + public JaxbOuterJoinAttribute getOuterJoin(); public String getBatchSize(); public boolean isInverse(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/SingularAttributeSource.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/SingularAttributeSource.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/SingularAttributeSource.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/SingularAttributeSource.java index 6163bbf281..0030cbe725 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/SingularAttributeSource.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/SingularAttributeSource.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; /** * @author Steve Ebersole @@ -31,7 +31,7 @@ public interface SingularAttributeSource extends MetaAttributeContainer { public String getTypeAttribute(); - public XMLTypeElement getType(); + public JaxbTypeElement getType(); public String getAccess(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/SubEntityElement.java b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/SubEntityElement.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/SubEntityElement.java rename to hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/SubEntityElement.java index 5055587a01..3d0dfd8284 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/jaxb/mapping/SubEntityElement.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/jaxb/mapping/hbm/SubEntityElement.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.metamodel.source.hbm.jaxb.mapping; +package org.hibernate.internal.jaxb.mapping.hbm; /** * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java b/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java index 21fdeb22ac..19974c0a34 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java @@ -43,12 +43,12 @@ import org.xml.sax.EntityResolver; import org.hibernate.cfg.EJB3DTDEntityResolver; import org.hibernate.cfg.EJB3NamingStrategy; import org.hibernate.cfg.NamingStrategy; +import org.hibernate.internal.jaxb.JaxbRoot; +import org.hibernate.internal.jaxb.Origin; +import org.hibernate.internal.jaxb.SourceType; import org.hibernate.metamodel.source.MappingException; import org.hibernate.metamodel.source.MappingNotFoundException; -import org.hibernate.metamodel.source.Origin; -import org.hibernate.metamodel.source.SourceType; import org.hibernate.metamodel.source.internal.JaxbHelper; -import org.hibernate.metamodel.source.internal.JaxbRoot; import org.hibernate.metamodel.source.internal.MetadataBuilderImpl; import org.hibernate.service.BasicServiceRegistry; import org.hibernate.service.classloading.spi.ClassLoaderService; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/LocalBindingContext.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/LocalBindingContext.java index c5b85a0cba..818beba54c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/LocalBindingContext.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/LocalBindingContext.java @@ -23,6 +23,8 @@ */ package org.hibernate.metamodel.source; +import org.hibernate.internal.jaxb.Origin; + /** * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingException.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingException.java index 279879e41f..47bd55cf87 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingException.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingException.java @@ -25,6 +25,7 @@ package org.hibernate.metamodel.source; import org.hibernate.HibernateException; +import org.hibernate.internal.jaxb.Origin; /** * Indicates a problem parsing a mapping document. diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingNotFoundException.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingNotFoundException.java index 3e56633c35..a0702f165e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingNotFoundException.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/MappingNotFoundException.java @@ -24,6 +24,8 @@ package org.hibernate.metamodel.source; +import org.hibernate.internal.jaxb.Origin; + /** * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/AnnotationMetadataSourceProcessorImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/AnnotationMetadataSourceProcessorImpl.java index b0dfe64a6d..d1379502bd 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/AnnotationMetadataSourceProcessorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/AnnotationMetadataSourceProcessorImpl.java @@ -35,10 +35,11 @@ import org.jboss.logging.Logger; import org.hibernate.AssertionFailure; import org.hibernate.HibernateException; +import org.hibernate.internal.jaxb.JaxbRoot; import org.hibernate.metamodel.MetadataSources; import org.hibernate.metamodel.source.MetadataImplementor; import org.hibernate.metamodel.source.MetadataSourceProcessor; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityMappings; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings; import org.hibernate.metamodel.source.annotations.global.FetchProfileBinder; import org.hibernate.metamodel.source.annotations.global.FilterDefBinder; import org.hibernate.metamodel.source.annotations.global.IdGeneratorBinder; @@ -49,7 +50,6 @@ import org.hibernate.metamodel.source.annotations.xml.PseudoJpaDotNames; import org.hibernate.metamodel.source.annotations.xml.mocker.EntityMappingsMocker; import org.hibernate.metamodel.source.binder.Binder; import org.hibernate.metamodel.source.binder.EntityHierarchy; -import org.hibernate.metamodel.source.internal.JaxbRoot; import org.hibernate.metamodel.source.internal.MetadataImpl; import org.hibernate.service.classloading.spi.ClassLoaderService; @@ -87,10 +87,10 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc Index index = indexer.complete(); - List> mappings = new ArrayList>(); + List> mappings = new ArrayList>(); for ( JaxbRoot root : sources.getJaxbRootList() ) { - if ( root.getRoot() instanceof XMLEntityMappings ) { - mappings.add( (JaxbRoot) root ); + if ( root.getRoot() instanceof JaxbEntityMappings ) { + mappings.add( (JaxbRoot) root ); } } if ( !mappings.isEmpty() ) { @@ -143,9 +143,9 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc FilterDefBinder.bind( bindingContext ); } - private Index parseAndUpdateIndex(List> mappings, Index annotationIndex) { - List list = new ArrayList( mappings.size() ); - for ( JaxbRoot jaxbRoot : mappings ) { + private Index parseAndUpdateIndex(List> mappings, Index annotationIndex) { + List list = new ArrayList( mappings.size() ); + for ( JaxbRoot jaxbRoot : mappings ) { list.add( jaxbRoot.getRoot() ); } return new EntityMappingsMocker( list, annotationIndex, metadata.getServiceRegistry() ).mockNewIndex(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBindingContext.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBindingContext.java index 2cd2c2b0c0..9c4f533cd0 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBindingContext.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBindingContext.java @@ -29,13 +29,13 @@ import org.jboss.jandex.ClassInfo; import org.jboss.jandex.Index; import org.hibernate.cfg.NamingStrategy; +import org.hibernate.internal.jaxb.Origin; +import org.hibernate.internal.jaxb.SourceType; import org.hibernate.internal.util.Value; import org.hibernate.metamodel.domain.Type; import org.hibernate.metamodel.source.LocalBindingContext; import org.hibernate.metamodel.source.MappingDefaults; import org.hibernate.metamodel.source.MetadataImplementor; -import org.hibernate.metamodel.source.Origin; -import org.hibernate.metamodel.source.SourceType; import org.hibernate.metamodel.source.annotations.AnnotationBindingContext; import org.hibernate.service.ServiceRegistry; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntitySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntitySourceImpl.java index 3da4e7a870..4c6c677e4e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntitySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntitySourceImpl.java @@ -29,9 +29,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.metamodel.binding.CustomSQL; import org.hibernate.metamodel.source.LocalBindingContext; -import org.hibernate.metamodel.source.Origin; import org.hibernate.metamodel.source.annotations.attribute.AssociationAttribute; import org.hibernate.metamodel.source.annotations.attribute.BasicAttribute; import org.hibernate.metamodel.source.annotations.attribute.SingularAttributeSourceImpl; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractAttributesBuilder.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractAttributesBuilder.java index 4efcf41c23..0c7dc1cfe3 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractAttributesBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractAttributesBuilder.java @@ -27,21 +27,21 @@ import java.util.List; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLBasic; -import org.hibernate.metamodel.source.annotation.jaxb.XMLElementCollection; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbedded; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddedId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToMany; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToOne; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToMany; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToOne; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTransient; -import org.hibernate.metamodel.source.annotation.jaxb.XMLVersion; +import org.hibernate.internal.jaxb.mapping.orm.JaxbBasic; +import org.hibernate.internal.jaxb.mapping.orm.JaxbElementCollection; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbedded; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddedId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTransient; +import org.hibernate.internal.jaxb.mapping.orm.JaxbVersion; /** - * Abstract Parser to handle {@link org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes XMLAttributes} - * and {@link org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddableAttributes XMLEmbeddableAttributes}. + * Abstract Parser to handle {@link org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes JaxbAttributes} + * and {@link org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddableAttributes JaxbEmbeddableAttributes}. * * It would be really helpful if these two classes can implement an interface with those abstract methods in this class. * @@ -60,40 +60,40 @@ abstract class AbstractAttributesBuilder { } final void parser() { - for ( XMLId id : getId() ) { + for ( JaxbId id : getId() ) { new IdMocker( indexBuilder, classInfo, defaults, id ).process(); } - for ( XMLTransient transientObj : getTransient() ) { + for ( JaxbTransient transientObj : getTransient() ) { new TransientMocker( indexBuilder, classInfo, defaults, transientObj ).process(); } - for ( XMLVersion version : getVersion() ) { + for ( JaxbVersion version : getVersion() ) { new VersionMocker( indexBuilder, classInfo, defaults, version ).process(); } - for ( XMLBasic basic : getBasic() ) { + for ( JaxbBasic basic : getBasic() ) { new BasicMocker( indexBuilder, classInfo, defaults, basic ).process(); } - for ( XMLElementCollection elementCollection : getElementCollection() ) { + for ( JaxbElementCollection elementCollection : getElementCollection() ) { new ElementCollectionMocker( indexBuilder, classInfo, defaults, elementCollection ).process(); } - for ( XMLEmbedded embedded : getEmbedded() ) { + for ( JaxbEmbedded embedded : getEmbedded() ) { new EmbeddedMocker( indexBuilder, classInfo, defaults, embedded ).process(); } - for ( XMLManyToMany manyToMany : getManyToMany() ) { + for ( JaxbManyToMany manyToMany : getManyToMany() ) { new ManyToManyMocker( indexBuilder, classInfo, defaults, manyToMany ).process(); } - for ( XMLManyToOne manyToOne : getManyToOne() ) { + for ( JaxbManyToOne manyToOne : getManyToOne() ) { new ManyToOneMocker( indexBuilder, classInfo, defaults, manyToOne ).process(); } - for ( XMLOneToMany oneToMany : getOneToMany() ) { + for ( JaxbOneToMany oneToMany : getOneToMany() ) { new OneToManyMocker( indexBuilder, classInfo, defaults, oneToMany ).process(); } - for ( XMLOneToOne oneToOne : getOneToOne() ) { + for ( JaxbOneToOne oneToOne : getOneToOne() ) { new OneToOneMocker( indexBuilder, classInfo, defaults, oneToOne ).process(); } if ( getEmbeddedId() != null ) { @@ -103,25 +103,25 @@ abstract class AbstractAttributesBuilder { } } - abstract List getId(); + abstract List getId(); - abstract List getTransient(); + abstract List getTransient(); - abstract List getVersion(); + abstract List getVersion(); - abstract List getBasic(); + abstract List getBasic(); - abstract List getElementCollection(); + abstract List getElementCollection(); - abstract List getEmbedded(); + abstract List getEmbedded(); - abstract List getManyToMany(); + abstract List getManyToMany(); - abstract List getManyToOne(); + abstract List getManyToOne(); - abstract List getOneToMany(); + abstract List getOneToMany(); - abstract List getOneToOne(); + abstract List getOneToOne(); - abstract XMLEmbeddedId getEmbeddedId(); + abstract JaxbEmbeddedId getEmbeddedId(); } \ No newline at end of file diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractEntityObjectMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractEntityObjectMocker.java index d479bc8ad3..54a7dbc16b 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractEntityObjectMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractEntityObjectMocker.java @@ -29,17 +29,17 @@ import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; import org.hibernate.AssertionFailure; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityListeners; -import org.hibernate.metamodel.source.annotation.jaxb.XMLIdClass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostLoad; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostPersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostUpdate; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPrePersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityListeners; +import org.hibernate.internal.jaxb.mapping.orm.JaxbIdClass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostLoad; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostPersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPrePersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreUpdate; /** * @author Strong Liu @@ -74,7 +74,7 @@ abstract class AbstractEntityObjectMocker extends AnnotationMocker { throw new AssertionFailure( "preProcess should be called before process" ); } if ( getAccessType() == null ) { - XMLAccessType accessType = AccessHelper.getEntityAccess( getTargetName(), indexBuilder ); + JaxbAccessType accessType = AccessHelper.getEntityAccess( getTargetName(), indexBuilder ); if ( accessType == null ) { accessType = getDefaults().getAccess(); } @@ -121,29 +121,29 @@ abstract class AbstractEntityObjectMocker extends AnnotationMocker { abstract protected boolean isExcludeSuperclassListeners(); - abstract protected XMLIdClass getIdClass(); + abstract protected JaxbIdClass getIdClass(); - abstract protected XMLEntityListeners getEntityListeners(); + abstract protected JaxbEntityListeners getEntityListeners(); - abstract protected XMLAccessType getAccessType(); + abstract protected JaxbAccessType getAccessType(); abstract protected String getClassName(); - abstract protected XMLPrePersist getPrePersist(); + abstract protected JaxbPrePersist getPrePersist(); - abstract protected XMLPreRemove getPreRemove(); + abstract protected JaxbPreRemove getPreRemove(); - abstract protected XMLPreUpdate getPreUpdate(); + abstract protected JaxbPreUpdate getPreUpdate(); - abstract protected XMLPostPersist getPostPersist(); + abstract protected JaxbPostPersist getPostPersist(); - abstract protected XMLPostUpdate getPostUpdate(); + abstract protected JaxbPostUpdate getPostUpdate(); - abstract protected XMLPostRemove getPostRemove(); + abstract protected JaxbPostRemove getPostRemove(); - abstract protected XMLPostLoad getPostLoad(); + abstract protected JaxbPostLoad getPostLoad(); - abstract protected XMLAttributes getAttributes(); + abstract protected JaxbAttributes getAttributes(); protected ListenerMocker getListenerParser() { if ( listenerParser == null ) { @@ -161,7 +161,7 @@ abstract class AbstractEntityObjectMocker extends AnnotationMocker { return attributesBuilder; } - protected AnnotationInstance parserIdClass(XMLIdClass idClass) { + protected AnnotationInstance parserIdClass(JaxbIdClass idClass) { if ( idClass == null ) { return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMocker.java index 4d91c50663..be9b93084a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMocker.java @@ -31,8 +31,8 @@ import org.jboss.jandex.AnnotationTarget; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.DotName; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLUniqueConstraint; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbUniqueConstraint; import org.hibernate.metamodel.source.annotations.JPADotNames; /** @@ -68,14 +68,14 @@ abstract class AbstractMocker implements JPADotNames { } - protected AnnotationInstance parserAccessType(XMLAccessType accessType, AnnotationTarget target) { + protected AnnotationInstance parserAccessType(JaxbAccessType accessType, AnnotationTarget target) { if ( accessType == null ) { return null; } return create( ACCESS, target, MockHelper.enumValueArray( "value", ACCESS_TYPE, accessType ) ); } - protected void nestedUniqueConstraintList(String name, List constraints, List annotationValueList) { + protected void nestedUniqueConstraintList(String name, List constraints, List annotationValueList) { if ( MockHelper.isNotEmpty( constraints ) ) { AnnotationValue[] values = new AnnotationValue[constraints.size()]; for ( int i = 0; i < constraints.size(); i++ ) { @@ -92,7 +92,7 @@ abstract class AbstractMocker implements JPADotNames { } //@UniqueConstraint - protected AnnotationInstance parserUniqueConstraint(XMLUniqueConstraint uniqueConstraint, AnnotationTarget target) { + protected AnnotationInstance parserUniqueConstraint(JaxbUniqueConstraint uniqueConstraint, AnnotationTarget target) { if ( uniqueConstraint == null ) { return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AccessHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AccessHelper.java index 034cf92499..ebc4db276e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AccessHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AccessHelper.java @@ -38,7 +38,7 @@ import org.hibernate.MappingException; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.metamodel.source.annotations.JandexHelper; import org.hibernate.metamodel.source.annotations.xml.PseudoJpaDotNames; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; import org.hibernate.metamodel.source.annotations.JPADotNames; /** @@ -50,7 +50,7 @@ class AccessHelper implements JPADotNames { AccessHelper.class.getName() ); - static XMLAccessType getAccessFromDefault(IndexBuilder indexBuilder) { + static JaxbAccessType getAccessFromDefault(IndexBuilder indexBuilder) { AnnotationInstance annotationInstance = JandexHelper.getSingleAnnotation( indexBuilder.getAnnotations(), PseudoJpaDotNames.DEFAULT_ACCESS @@ -59,15 +59,15 @@ class AccessHelper implements JPADotNames { return null; } else { - return JandexHelper.getEnumValue( annotationInstance, "value", XMLAccessType.class ); + return JandexHelper.getEnumValue( annotationInstance, "value", JaxbAccessType.class ); } } - static XMLAccessType getAccessFromIdPosition(DotName className, IndexBuilder indexBuilder) { + static JaxbAccessType getAccessFromIdPosition(DotName className, IndexBuilder indexBuilder) { Map> indexedAnnotations = indexBuilder.getIndexedAnnotations( className ); Map> ormAnnotations = indexBuilder.getClassInfoAnnotationsMap( className ); - XMLAccessType accessType = getAccessFromIdPosition( ormAnnotations ); + JaxbAccessType accessType = getAccessFromIdPosition( ormAnnotations ); if ( accessType == null ) { accessType = getAccessFromIdPosition( indexedAnnotations ); } @@ -86,7 +86,7 @@ class AccessHelper implements JPADotNames { return accessType; } - private static XMLAccessType getAccessFromIdPosition(Map> annotations) { + private static JaxbAccessType getAccessFromIdPosition(Map> annotations) { if ( annotations == null || annotations.isEmpty() || !( annotations.containsKey( ID ) ) ) { return null; } @@ -97,8 +97,8 @@ class AccessHelper implements JPADotNames { return null; } - private static XMLAccessType processIdAnnotations(List idAnnotations) { - XMLAccessType accessType = null; + private static JaxbAccessType processIdAnnotations(List idAnnotations) { + JaxbAccessType accessType = null; for ( AnnotationInstance annotation : idAnnotations ) { AnnotationTarget tmpTarget = annotation.target(); if ( tmpTarget == null ) { @@ -116,14 +116,14 @@ class AccessHelper implements JPADotNames { return accessType; } - static XMLAccessType annotationTargetToAccessType(AnnotationTarget target) { - return ( target instanceof MethodInfo ) ? XMLAccessType.PROPERTY : XMLAccessType.FIELD; + static JaxbAccessType annotationTargetToAccessType(AnnotationTarget target) { + return ( target instanceof MethodInfo ) ? JaxbAccessType.PROPERTY : JaxbAccessType.FIELD; } - static XMLAccessType getEntityAccess(DotName className, IndexBuilder indexBuilder) { + static JaxbAccessType getEntityAccess(DotName className, IndexBuilder indexBuilder) { Map> indexedAnnotations = indexBuilder.getIndexedAnnotations( className ); Map> ormAnnotations = indexBuilder.getClassInfoAnnotationsMap( className ); - XMLAccessType accessType = getAccess( ormAnnotations ); + JaxbAccessType accessType = getAccess( ormAnnotations ); if ( accessType == null ) { accessType = getAccess( indexedAnnotations ); } @@ -141,7 +141,7 @@ class AccessHelper implements JPADotNames { } - private static XMLAccessType getAccess(Map> annotations) { + private static JaxbAccessType getAccess(Map> annotations) { if ( annotations == null || annotations.isEmpty() || !isEntityObject( annotations ) ) { return null; } @@ -152,7 +152,7 @@ class AccessHelper implements JPADotNames { return JandexHelper.getEnumValue( annotationInstance, "value", - XMLAccessType.class + JaxbAccessType.class ); } } @@ -168,7 +168,7 @@ class AccessHelper implements JPADotNames { /** * Get {@link javax.persistence.AccessType } from {@link javax.persistence.Access @Access} on the attribute of the given class */ - static XMLAccessType getAccessFromAttributeAnnotation(DotName className, String attributeName, IndexBuilder indexBuilder) { + static JaxbAccessType getAccessFromAttributeAnnotation(DotName className, String attributeName, IndexBuilder indexBuilder) { Map> indexedAnnotations = indexBuilder.getIndexedAnnotations( className ); if ( indexedAnnotations != null && indexedAnnotations.containsKey( ACCESS ) ) { List annotationInstances = indexedAnnotations.get( ACCESS ); @@ -179,15 +179,15 @@ class AccessHelper implements JPADotNames { continue; } if ( JandexHelper.getPropertyName( indexedPropertyTarget ).equals( attributeName ) ) { - XMLAccessType accessType = JandexHelper.getEnumValue( + JaxbAccessType accessType = JandexHelper.getEnumValue( annotationInstance, "value", - XMLAccessType.class + JaxbAccessType.class ); /** * here we ignore @Access(FIELD) on property (getter) and @Access(PROPERTY) on field */ - XMLAccessType targetAccessType = annotationTargetToAccessType( indexedPropertyTarget ); + JaxbAccessType targetAccessType = annotationTargetToAccessType( indexedPropertyTarget ); if ( accessType.equals( targetAccessType ) ) { return targetAccessType; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AnnotationMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AnnotationMocker.java index ecccf5151f..d416e265a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AnnotationMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AnnotationMocker.java @@ -35,17 +35,17 @@ import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.DotName; import org.hibernate.AssertionFailure; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAssociationOverride; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributeOverride; -import org.hibernate.metamodel.source.annotation.jaxb.XMLCollectionTable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEnumType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLJoinColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLJoinTable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLLob; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOrderColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPrimaryKeyJoinColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTemporalType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAssociationOverride; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributeOverride; +import org.hibernate.internal.jaxb.mapping.orm.JaxbCollectionTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEnumType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbJoinColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbJoinTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbLob; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOrderColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPrimaryKeyJoinColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTemporalType; /** * @author Strong Liu @@ -69,7 +69,7 @@ abstract class AnnotationMocker extends AbstractMocker { } //@JoinTable - protected AnnotationInstance parserJoinTable(XMLJoinTable joinTable, AnnotationTarget target) { + protected AnnotationInstance parserJoinTable(JaxbJoinTable joinTable, AnnotationTarget target) { if ( joinTable == null ) { return null; } @@ -92,14 +92,14 @@ abstract class AnnotationMocker extends AbstractMocker { } //@AssociationOverride - private AnnotationInstance parserAssociationOverride(XMLAssociationOverride associationOverride, AnnotationTarget target) { + private AnnotationInstance parserAssociationOverride(JaxbAssociationOverride associationOverride, AnnotationTarget target) { if ( associationOverride == null ) { return null; } List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", associationOverride.getName(), annotationValueList ); - if ( associationOverride instanceof XMLAssociationOverrideProxy ) { - XMLAssociationOverrideProxy proxy = (XMLAssociationOverrideProxy) associationOverride; + if ( associationOverride instanceof JaxbAssociationOverrideProxy ) { + JaxbAssociationOverrideProxy proxy = (JaxbAssociationOverrideProxy) associationOverride; MockHelper.addToCollectionIfNotNull( annotationValueList, proxy.getJoinColumnsAnnotationValue() ); MockHelper.addToCollectionIfNotNull( annotationValueList, proxy.getJoinTableAnnotationValue() ); } @@ -114,7 +114,7 @@ abstract class AnnotationMocker extends AbstractMocker { return create( ASSOCIATION_OVERRIDE, target, annotationValueList ); } - private AnnotationValue[] nestedJoinColumnList(String name, List columns, List annotationValueList) { + private AnnotationValue[] nestedJoinColumnList(String name, List columns, List annotationValueList) { if ( MockHelper.isNotEmpty( columns ) ) { AnnotationValue[] values = new AnnotationValue[columns.size()]; for ( int i = 0; i < columns.size(); i++ ) { @@ -133,7 +133,7 @@ abstract class AnnotationMocker extends AbstractMocker { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //@Column - protected AnnotationInstance parserColumn(XMLColumn column, AnnotationTarget target) { + protected AnnotationInstance parserColumn(JaxbColumn column, AnnotationTarget target) { if ( column == null ) { return null; } @@ -152,14 +152,14 @@ abstract class AnnotationMocker extends AbstractMocker { } //@AttributeOverride - private AnnotationInstance parserAttributeOverride(XMLAttributeOverride attributeOverride, AnnotationTarget target) { + private AnnotationInstance parserAttributeOverride(JaxbAttributeOverride attributeOverride, AnnotationTarget target) { if ( attributeOverride == null ) { return null; } List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", attributeOverride.getName(), annotationValueList ); - if ( attributeOverride instanceof XMLAttributeOverrideProxy ) { - XMLAttributeOverrideProxy proxy = (XMLAttributeOverrideProxy) attributeOverride; + if ( attributeOverride instanceof JaxbAttributeOverrideProxy ) { + JaxbAttributeOverrideProxy proxy = (JaxbAttributeOverrideProxy) attributeOverride; MockHelper.addToCollectionIfNotNull( annotationValueList, proxy.getColumnAnnotationValue() ); } else { @@ -175,7 +175,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - protected AnnotationInstance parserOrderColumn(XMLOrderColumn orderColumn, AnnotationTarget target) { + protected AnnotationInstance parserOrderColumn(JaxbOrderColumn orderColumn, AnnotationTarget target) { if ( orderColumn == null ) { return null; } @@ -189,7 +189,7 @@ abstract class AnnotationMocker extends AbstractMocker { } //@JoinColumn - protected AnnotationInstance parserJoinColumn(XMLJoinColumn column, AnnotationTarget target) { + protected AnnotationInstance parserJoinColumn(JaxbJoinColumn column, AnnotationTarget target) { if ( column == null ) { return null; } @@ -207,21 +207,21 @@ abstract class AnnotationMocker extends AbstractMocker { return create( JOIN_COLUMN, target, annotationValueList ); } - protected AnnotationInstance parserLob(XMLLob lob, AnnotationTarget target) { + protected AnnotationInstance parserLob(JaxbLob lob, AnnotationTarget target) { if ( lob == null ) { return null; } return create( LOB, target ); } - protected AnnotationInstance parserTemporalType(XMLTemporalType temporalType, AnnotationTarget target) { + protected AnnotationInstance parserTemporalType(JaxbTemporalType temporalType, AnnotationTarget target) { if ( temporalType == null ) { return null; } return create( TEMPORAL, target, MockHelper.enumValueArray( "value", TEMPORAL_TYPE, temporalType ) ); } - protected AnnotationInstance parserEnumType(XMLEnumType enumerated, AnnotationTarget target) { + protected AnnotationInstance parserEnumType(JaxbEnumType enumerated, AnnotationTarget target) { if ( enumerated == null ) { return null; } @@ -229,7 +229,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - protected AnnotationInstance parserPrimaryKeyJoinColumn(XMLPrimaryKeyJoinColumn primaryKeyJoinColumn, AnnotationTarget target) { + protected AnnotationInstance parserPrimaryKeyJoinColumn(JaxbPrimaryKeyJoinColumn primaryKeyJoinColumn, AnnotationTarget target) { if ( primaryKeyJoinColumn == null ) { return null; } @@ -248,7 +248,7 @@ abstract class AnnotationMocker extends AbstractMocker { ); } - protected AnnotationInstance parserPrimaryKeyJoinColumnList(List primaryKeyJoinColumnList, AnnotationTarget target) { + protected AnnotationInstance parserPrimaryKeyJoinColumnList(List primaryKeyJoinColumnList, AnnotationTarget target) { if ( MockHelper.isNotEmpty( primaryKeyJoinColumnList ) ) { if ( primaryKeyJoinColumnList.size() == 1 ) { return parserPrimaryKeyJoinColumn( primaryKeyJoinColumnList.get( 0 ), target ); @@ -266,7 +266,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - protected AnnotationValue[] nestedPrimaryKeyJoinColumnList(String name, List constraints, List annotationValueList) { + protected AnnotationValue[] nestedPrimaryKeyJoinColumnList(String name, List constraints, List annotationValueList) { if ( MockHelper.isNotEmpty( constraints ) ) { AnnotationValue[] values = new AnnotationValue[constraints.size()]; for ( int i = 0; i < constraints.size(); i++ ) { @@ -303,7 +303,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - protected AnnotationInstance parserAttributeOverrides(List attributeOverrides, AnnotationTarget target) { + protected AnnotationInstance parserAttributeOverrides(List attributeOverrides, AnnotationTarget target) { if ( target == null ) { throw new AssertionFailure( "target can not be null" ); } @@ -311,7 +311,7 @@ abstract class AnnotationMocker extends AbstractMocker { return null; } Set names = new HashSet(); - for ( XMLAttributeOverride attributeOverride : attributeOverrides ) { + for ( JaxbAttributeOverride attributeOverride : attributeOverrides ) { names.add( attributeOverride.getName() ); } Operation operation = new AttributeOverrideOperation( names, attributeOverrides ); @@ -339,7 +339,7 @@ abstract class AnnotationMocker extends AbstractMocker { } } - protected AnnotationInstance parserAssociationOverrides(List associationOverrides, AnnotationTarget target) { + protected AnnotationInstance parserAssociationOverrides(List associationOverrides, AnnotationTarget target) { if ( target == null ) { throw new AssertionFailure( "target can not be null" ); } @@ -348,7 +348,7 @@ abstract class AnnotationMocker extends AbstractMocker { } Set names = new HashSet(); - for ( XMLAssociationOverride associationOverride : associationOverrides ) { + for ( JaxbAssociationOverride associationOverride : associationOverrides ) { names.add( associationOverride.getName() ); } Operation operation = new AssociationOverrideOperation( names, associationOverrides ); @@ -379,7 +379,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - protected AnnotationInstance parserCollectionTable(XMLCollectionTable collectionTable, AnnotationTarget target) { + protected AnnotationInstance parserCollectionTable(JaxbCollectionTable collectionTable, AnnotationTarget target) { if ( collectionTable == null ) { return null; } @@ -397,7 +397,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - protected AnnotationInstance parserJoinColumnList(List joinColumnList, AnnotationTarget target) { + protected AnnotationInstance parserJoinColumnList(List joinColumnList, AnnotationTarget target) { if ( MockHelper.isNotEmpty( joinColumnList ) ) { if ( joinColumnList.size() == 1 ) { return parserJoinColumn( joinColumnList.get( 0 ), target ); @@ -439,9 +439,9 @@ abstract class AnnotationMocker extends AbstractMocker { class AttributeOverrideOperation implements Operation { private Set names; - private List attributeOverrides; + private List attributeOverrides; - AttributeOverrideOperation(Set names, List attributeOverrides) { + AttributeOverrideOperation(Set names, List attributeOverrides) { this.names = names; this.attributeOverrides = attributeOverrides; } @@ -450,7 +450,7 @@ abstract class AnnotationMocker extends AbstractMocker { public boolean process(AnnotationInstance annotationInstance) { String name = annotationInstance.value( "name" ).asString(); if ( !names.contains( name ) ) { - XMLAttributeOverrideProxy attributeOverride = new XMLAttributeOverrideProxy(); + JaxbAttributeOverrideProxy attributeOverride = new JaxbAttributeOverrideProxy(); attributeOverride.setName( name ); attributeOverride.setColumnAnnotationValue( annotationInstance.value( "column" ) ); attributeOverrides.add( attributeOverride ); @@ -462,9 +462,9 @@ abstract class AnnotationMocker extends AbstractMocker { class AssociationOverrideOperation implements Operation { private Set names; - private List associationOverrides; + private List associationOverrides; - AssociationOverrideOperation(Set names, List associationOverrides) { + AssociationOverrideOperation(Set names, List associationOverrides) { this.names = names; this.associationOverrides = associationOverrides; } @@ -473,7 +473,7 @@ abstract class AnnotationMocker extends AbstractMocker { public boolean process(AnnotationInstance annotationInstance) { String name = annotationInstance.value( "name" ).asString(); if ( !names.contains( name ) ) { - XMLAssociationOverrideProxy associationOverride = new XMLAssociationOverrideProxy(); + JaxbAssociationOverrideProxy associationOverride = new JaxbAssociationOverrideProxy(); associationOverride.setName( name ); associationOverride.setJoinColumnsAnnotationValue( annotationInstance.value( "joinColumns" ) ); associationOverride.setJoinTableAnnotationValue( annotationInstance.value( "joinTable" ) ); @@ -484,7 +484,7 @@ abstract class AnnotationMocker extends AbstractMocker { } - class XMLAssociationOverrideProxy extends XMLAssociationOverride { + class JaxbAssociationOverrideProxy extends JaxbAssociationOverride { private AnnotationValue joinTableAnnotationValue; private AnnotationValue joinColumnsAnnotationValue; @@ -505,7 +505,7 @@ abstract class AnnotationMocker extends AbstractMocker { } } - class XMLAttributeOverrideProxy extends XMLAttributeOverride { + class JaxbAttributeOverrideProxy extends JaxbAttributeOverride { private AnnotationValue columnAnnotationValue; AnnotationValue getColumnAnnotationValue() { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AttributesBuilder.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AttributesBuilder.java index 13fc86e9f0..9c54c26697 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AttributesBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/AttributesBuilder.java @@ -27,83 +27,83 @@ import java.util.List; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLBasic; -import org.hibernate.metamodel.source.annotation.jaxb.XMLElementCollection; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbedded; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddedId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToMany; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToOne; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToMany; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToOne; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTransient; -import org.hibernate.metamodel.source.annotation.jaxb.XMLVersion; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbBasic; +import org.hibernate.internal.jaxb.mapping.orm.JaxbElementCollection; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbedded; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddedId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTransient; +import org.hibernate.internal.jaxb.mapping.orm.JaxbVersion; /** * @author Strong Liu */ class AttributesBuilder extends AbstractAttributesBuilder { - private XMLAttributes attributes; + private JaxbAttributes attributes; - AttributesBuilder(IndexBuilder indexBuilder, ClassInfo classInfo, XMLAccessType accessType, EntityMappingsMocker.Default defaults, XMLAttributes attributes) { + AttributesBuilder(IndexBuilder indexBuilder, ClassInfo classInfo, JaxbAccessType accessType, EntityMappingsMocker.Default defaults, JaxbAttributes attributes) { super( indexBuilder, classInfo, defaults ); this.attributes = attributes; } @Override - List getBasic() { + List getBasic() { return attributes.getBasic(); } @Override - List getId() { + List getId() { return attributes.getId(); } @Override - List getTransient() { + List getTransient() { return attributes.getTransient(); } @Override - List getVersion() { + List getVersion() { return attributes.getVersion(); } @Override - List getElementCollection() { + List getElementCollection() { return attributes.getElementCollection(); } @Override - List getEmbedded() { + List getEmbedded() { return attributes.getEmbedded(); } @Override - List getManyToMany() { + List getManyToMany() { return attributes.getManyToMany(); } @Override - List getManyToOne() { + List getManyToOne() { return attributes.getManyToOne(); } @Override - List getOneToMany() { + List getOneToMany() { return attributes.getOneToMany(); } @Override - List getOneToOne() { + List getOneToOne() { return attributes.getOneToOne(); } @Override - XMLEmbeddedId getEmbeddedId() { + JaxbEmbeddedId getEmbeddedId() { return attributes.getEmbeddedId(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMocker.java index f8b556df38..be9f854c59 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMocker.java @@ -29,16 +29,16 @@ import java.util.List; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLBasic; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbBasic; /** * @author Strong Liu */ class BasicMocker extends PropertyMocker { - private XMLBasic basic; + private JaxbBasic basic; - BasicMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLBasic basic) { + BasicMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbBasic basic) { super( indexBuilder, classInfo, defaults ); this.basic = basic; } @@ -63,12 +63,12 @@ class BasicMocker extends PropertyMocker { @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return basic.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { basic.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelper.java index 77af5a6847..13dc54480c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelper.java @@ -37,10 +37,10 @@ import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.source.annotations.JPADotNames; import org.hibernate.metamodel.source.annotations.JandexHelper; import org.hibernate.metamodel.source.annotations.xml.filter.IndexedAnnotationFilter; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMappedSuperclass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMappedSuperclass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTable; /** * @author Strong Liu @@ -100,15 +100,15 @@ class DefaultConfigurationHelper { } } - void applyDefaults(XMLMappedSuperclass mappedSuperclass, EntityMappingsMocker.Default defaults) { + void applyDefaults(JaxbMappedSuperclass mappedSuperclass, EntityMappingsMocker.Default defaults) { applyDefaultsToEntityObject( new MappedSuperClassEntityObject( mappedSuperclass ), defaults ); } - void applyDefaults(XMLEmbeddable embeddable, EntityMappingsMocker.Default defaults) { + void applyDefaults(JaxbEmbeddable embeddable, EntityMappingsMocker.Default defaults) { applyDefaultsToEntityObject( new EmbeddableEntityObject( embeddable ), defaults ); } - void applyDefaults(XMLEntity entity, EntityMappingsMocker.Default defaults) { + void applyDefaults(JaxbEntity entity, EntityMappingsMocker.Default defaults) { mockTableIfNonExist( entity, defaults ); applyDefaultsToEntityObject( new EntityEntityObject( entity ), defaults ); } @@ -162,11 +162,11 @@ class DefaultConfigurationHelper { } } - private void mockTableIfNonExist(XMLEntity entity, EntityMappingsMocker.Default defaults) { + private void mockTableIfNonExist(JaxbEntity entity, EntityMappingsMocker.Default defaults) { if ( hasSchemaOrCatalogDefined( defaults ) ) { - XMLTable table = entity.getTable(); + JaxbTable table = entity.getTable(); if ( table == null ) { - table = new XMLTable(); + table = new JaxbTable(); entity.setTable( table ); } } @@ -303,9 +303,9 @@ class DefaultConfigurationHelper { } private static class EntityEntityObject implements EntityObject { - private XMLEntity entity; + private JaxbEntity entity; - private EntityEntityObject(XMLEntity entity) { + private EntityEntityObject(JaxbEntity entity) { this.entity = entity; } @@ -331,9 +331,9 @@ class DefaultConfigurationHelper { } private static class EmbeddableEntityObject implements EntityObject { - private XMLEmbeddable entity; + private JaxbEmbeddable entity; - private EmbeddableEntityObject(XMLEmbeddable entity) { + private EmbeddableEntityObject(JaxbEmbeddable entity) { this.entity = entity; } @@ -359,9 +359,9 @@ class DefaultConfigurationHelper { } private static class MappedSuperClassEntityObject implements EntityObject { - private XMLMappedSuperclass entity; + private JaxbMappedSuperclass entity; - private MappedSuperClassEntityObject(XMLMappedSuperclass entity) { + private MappedSuperClassEntityObject(JaxbMappedSuperclass entity) { this.entity = entity; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ElementCollectionMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ElementCollectionMocker.java index 84c25a00cf..2649e4358b 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ElementCollectionMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ElementCollectionMocker.java @@ -29,16 +29,16 @@ import java.util.List; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLElementCollection; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbElementCollection; /** * @author Strong Liu */ class ElementCollectionMocker extends PropertyMocker { - private XMLElementCollection elementCollection; + private JaxbElementCollection elementCollection; - ElementCollectionMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLElementCollection elementCollection) { + ElementCollectionMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbElementCollection elementCollection) { super( indexBuilder, classInfo, defaults ); this.elementCollection = elementCollection; } @@ -79,12 +79,12 @@ class ElementCollectionMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return elementCollection.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { elementCollection.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableAttributesBuilder.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableAttributesBuilder.java index ee10cd8a94..8850417cb3 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableAttributesBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableAttributesBuilder.java @@ -28,83 +28,83 @@ import java.util.List; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLBasic; -import org.hibernate.metamodel.source.annotation.jaxb.XMLElementCollection; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddableAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbedded; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddedId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToMany; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToOne; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToMany; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToOne; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTransient; -import org.hibernate.metamodel.source.annotation.jaxb.XMLVersion; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbBasic; +import org.hibernate.internal.jaxb.mapping.orm.JaxbElementCollection; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddableAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbedded; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddedId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTransient; +import org.hibernate.internal.jaxb.mapping.orm.JaxbVersion; /** * @author Strong Liu */ class EmbeddableAttributesBuilder extends AbstractAttributesBuilder { - private XMLEmbeddableAttributes attributes; + private JaxbEmbeddableAttributes attributes; - EmbeddableAttributesBuilder(IndexBuilder indexBuilder, ClassInfo classInfo, XMLAccessType accessType, EntityMappingsMocker.Default defaults, XMLEmbeddableAttributes embeddableAttributes) { + EmbeddableAttributesBuilder(IndexBuilder indexBuilder, ClassInfo classInfo, JaxbAccessType accessType, EntityMappingsMocker.Default defaults, JaxbEmbeddableAttributes embeddableAttributes) { super( indexBuilder, classInfo, defaults ); this.attributes = embeddableAttributes; } @Override - List getBasic() { + List getBasic() { return attributes.getBasic(); } @Override - List getId() { + List getId() { return Collections.emptyList(); } @Override - List getTransient() { + List getTransient() { return attributes.getTransient(); } @Override - List getVersion() { + List getVersion() { return Collections.emptyList(); } @Override - List getElementCollection() { + List getElementCollection() { return attributes.getElementCollection(); } @Override - List getEmbedded() { + List getEmbedded() { return attributes.getEmbedded(); } @Override - List getManyToMany() { + List getManyToMany() { return attributes.getManyToMany(); } @Override - List getManyToOne() { + List getManyToOne() { return attributes.getManyToOne(); } @Override - List getOneToMany() { + List getOneToMany() { return attributes.getOneToMany(); } @Override - List getOneToOne() { + List getOneToOne() { return attributes.getOneToOne(); } @Override - XMLEmbeddedId getEmbeddedId() { + JaxbEmbeddedId getEmbeddedId() { return null; } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableMocker.java index 1fe68b3c74..3bbe7914b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddableMocker.java @@ -26,18 +26,18 @@ package org.hibernate.metamodel.source.annotations.xml.mocker; import org.jboss.logging.Logger; import org.hibernate.internal.CoreMessageLogger; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityListeners; -import org.hibernate.metamodel.source.annotation.jaxb.XMLIdClass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostLoad; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostPersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostUpdate; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPrePersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityListeners; +import org.hibernate.internal.jaxb.mapping.orm.JaxbIdClass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostLoad; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostPersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPrePersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreUpdate; /** * Mock to {@link javax.persistence.Embeddable @Embeddable} @@ -49,9 +49,9 @@ class EmbeddableMocker extends AbstractEntityObjectMocker { CoreMessageLogger.class, EmbeddableMocker.class.getName() ); - private XMLEmbeddable embeddable; + private JaxbEmbeddable embeddable; - EmbeddableMocker(IndexBuilder indexBuilder, XMLEmbeddable embeddable, EntityMappingsMocker.Default defaults) { + EmbeddableMocker(IndexBuilder indexBuilder, JaxbEmbeddable embeddable, EntityMappingsMocker.Default defaults) { super( indexBuilder, defaults ); this.embeddable = embeddable; } @@ -92,17 +92,17 @@ class EmbeddableMocker extends AbstractEntityObjectMocker { } @Override - protected XMLIdClass getIdClass() { + protected JaxbIdClass getIdClass() { return null; } @Override - protected XMLEntityListeners getEntityListeners() { + protected JaxbEntityListeners getEntityListeners() { return null; } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return embeddable.getAccess(); } @@ -112,42 +112,42 @@ class EmbeddableMocker extends AbstractEntityObjectMocker { } @Override - protected XMLPrePersist getPrePersist() { + protected JaxbPrePersist getPrePersist() { return null; } @Override - protected XMLPreRemove getPreRemove() { + protected JaxbPreRemove getPreRemove() { return null; } @Override - protected XMLPreUpdate getPreUpdate() { + protected JaxbPreUpdate getPreUpdate() { return null; } @Override - protected XMLPostPersist getPostPersist() { + protected JaxbPostPersist getPostPersist() { return null; } @Override - protected XMLPostUpdate getPostUpdate() { + protected JaxbPostUpdate getPostUpdate() { return null; } @Override - protected XMLPostRemove getPostRemove() { + protected JaxbPostRemove getPostRemove() { return null; } @Override - protected XMLPostLoad getPostLoad() { + protected JaxbPostLoad getPostLoad() { return null; } @Override - protected XMLAttributes getAttributes() { + protected JaxbAttributes getAttributes() { return null; } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedIdMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedIdMocker.java index 0ea66f870d..622304ce98 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedIdMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedIdMocker.java @@ -25,16 +25,16 @@ package org.hibernate.metamodel.source.annotations.xml.mocker; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddedId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddedId; /** * @author Strong Liu */ class EmbeddedIdMocker extends PropertyMocker { - private XMLEmbeddedId embeddedId; + private JaxbEmbeddedId embeddedId; - EmbeddedIdMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLEmbeddedId embeddedId) { + EmbeddedIdMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbEmbeddedId embeddedId) { super( indexBuilder, classInfo, defaults ); this.embeddedId = embeddedId; } @@ -50,12 +50,12 @@ class EmbeddedIdMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return embeddedId.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { embeddedId.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedMocker.java index e2f6f94c5a..0be35d0759 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EmbeddedMocker.java @@ -25,16 +25,16 @@ package org.hibernate.metamodel.source.annotations.xml.mocker; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbedded; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbedded; /** * @author Strong Liu */ class EmbeddedMocker extends PropertyMocker { - private XMLEmbedded embedded; + private JaxbEmbedded embedded; - EmbeddedMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLEmbedded embedded) { + EmbeddedMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbEmbedded embedded) { super( indexBuilder, classInfo, defaults ); this.embedded = embedded; } @@ -53,12 +53,12 @@ class EmbeddedMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return embedded.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { embedded.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMappingsMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMappingsMocker.java index ad5acc3ebf..056456a1e8 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMappingsMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMappingsMocker.java @@ -31,17 +31,17 @@ import org.jboss.jandex.Index; import org.jboss.logging.Logger; import org.hibernate.internal.CoreMessageLogger; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEmbeddable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityMappings; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMappedSuperclass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPersistenceUnitDefaults; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPersistenceUnitMetadata; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEmbeddable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMappedSuperclass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPersistenceUnitDefaults; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPersistenceUnitMetadata; import org.hibernate.service.ServiceRegistry; /** - * Parse all {@link XMLEntityMappings} generated from orm.xml. + * Parse all {@link org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings} generated from orm.xml. * * @author Strong Liu */ @@ -50,7 +50,7 @@ public class EntityMappingsMocker { CoreMessageLogger.class, EntityMappingsMocker.class.getName() ); - private final List entityMappingsList; + private final List entityMappingsList; /** * Default configuration defined in Persistence Metadata Unit, one or zero per Persistence Unit. */ @@ -58,14 +58,14 @@ public class EntityMappingsMocker { private final IndexBuilder indexBuilder; private final GlobalAnnotations globalAnnotations; - public EntityMappingsMocker(List entityMappingsList, Index index, ServiceRegistry serviceRegistry) { + public EntityMappingsMocker(List entityMappingsList, Index index, ServiceRegistry serviceRegistry) { this.entityMappingsList = entityMappingsList; this.indexBuilder = new IndexBuilder( index, serviceRegistry ); this.globalAnnotations = new GlobalAnnotations(); } /** - * Create new {@link Index} with mocking JPA annotations from {@link XMLEntityMappings} and merge them with existing {@link Index} + * Create new {@link Index} with mocking JPA annotations from {@link org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings} and merge them with existing {@link Index} * * @return new {@link Index} */ @@ -79,10 +79,10 @@ public class EntityMappingsMocker { /** * processing PersistenceUnitMetadata, there should be only one PersistenceUnitMetadata in all mapping xml files. */ - private void processPersistenceUnitMetadata(List entityMappingsList) { - for ( XMLEntityMappings entityMappings : entityMappingsList ) { + private void processPersistenceUnitMetadata(List entityMappingsList) { + for ( JaxbEntityMappings entityMappings : entityMappingsList ) { //we have to iterate entityMappingsList first to find persistence-unit-metadata - XMLPersistenceUnitMetadata pum = entityMappings.getPersistenceUnitMetadata(); + JaxbPersistenceUnitMetadata pum = entityMappings.getPersistenceUnitMetadata(); if ( globalDefaults != null ) { LOG.duplicateMetadata(); return; @@ -95,7 +95,7 @@ public class EntityMappingsMocker { globalDefaults.setMetadataComplete( true ); indexBuilder.mappingMetadataComplete(); } - XMLPersistenceUnitDefaults pud = pum.getPersistenceUnitDefaults(); + JaxbPersistenceUnitDefaults pud = pum.getPersistenceUnitDefaults(); if ( pud == null ) { return; } @@ -108,24 +108,24 @@ public class EntityMappingsMocker { } - private void processEntityMappings(List entityMappingsList) { + private void processEntityMappings(List entityMappingsList) { List mockerList = new ArrayList(); - for ( XMLEntityMappings entityMappings : entityMappingsList ) { + for ( JaxbEntityMappings entityMappings : entityMappingsList ) { final Default defaults = getEntityMappingsDefaults( entityMappings ); globalAnnotations.collectGlobalMappings( entityMappings, defaults ); - for ( XMLMappedSuperclass mappedSuperclass : entityMappings.getMappedSuperclass() ) { + for ( JaxbMappedSuperclass mappedSuperclass : entityMappings.getMappedSuperclass() ) { AbstractEntityObjectMocker mocker = new MappedSuperclassMocker( indexBuilder, mappedSuperclass, defaults ); mockerList.add( mocker ); mocker.preProcess(); } - for ( XMLEmbeddable embeddable : entityMappings.getEmbeddable() ) { + for ( JaxbEmbeddable embeddable : entityMappings.getEmbeddable() ) { AbstractEntityObjectMocker mocker = new EmbeddableMocker( indexBuilder, embeddable, defaults ); mockerList.add( mocker ); mocker.preProcess(); } - for ( XMLEntity entity : entityMappings.getEntity() ) { + for ( JaxbEntity entity : entityMappings.getEntity() ) { globalAnnotations.collectGlobalMappings( entity, defaults ); AbstractEntityObjectMocker mocker = new EntityMocker( indexBuilder, entity, defaults ); @@ -147,7 +147,7 @@ public class EntityMappingsMocker { } } - private Default getEntityMappingsDefaults(XMLEntityMappings entityMappings) { + private Default getEntityMappingsDefaults(JaxbEntityMappings entityMappings) { Default entityMappingDefault = new Default(); entityMappingDefault.setPackageName( entityMappings.getPackage() ); entityMappingDefault.setSchema( entityMappings.getSchema() ); @@ -161,18 +161,18 @@ public class EntityMappingsMocker { public static class Default implements Serializable { - private XMLAccessType access; + private JaxbAccessType access; private String packageName; private String schema; private String catalog; private Boolean metadataComplete; private Boolean cascadePersist; - public XMLAccessType getAccess() { + public JaxbAccessType getAccess() { return access; } - void setAccess(XMLAccessType access) { + void setAccess(JaxbAccessType access) { this.access = access; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMocker.java index 757c746841..04561f55a8 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/EntityMocker.java @@ -36,23 +36,23 @@ import org.jboss.jandex.DotName; import org.jboss.logging.Logger; import org.hibernate.internal.CoreMessageLogger; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; import org.hibernate.internal.util.StringHelper; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLDiscriminatorColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityListeners; -import org.hibernate.metamodel.source.annotation.jaxb.XMLIdClass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLInheritance; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostLoad; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostPersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostUpdate; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPrePersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreUpdate; -import org.hibernate.metamodel.source.annotation.jaxb.XMLSecondaryTable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbDiscriminatorColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityListeners; +import org.hibernate.internal.jaxb.mapping.orm.JaxbIdClass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbInheritance; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostLoad; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostPersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPrePersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbSecondaryTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTable; /** * Mock to {@link javax.persistence.Entity @Entity} @@ -64,9 +64,9 @@ class EntityMocker extends AbstractEntityObjectMocker { CoreMessageLogger.class, EntityMocker.class.getName() ); - private XMLEntity entity; + private JaxbEntity entity; - EntityMocker(IndexBuilder indexBuilder, XMLEntity entity, EntityMappingsMocker.Default defaults) { + EntityMocker(IndexBuilder indexBuilder, JaxbEntity entity, EntityMappingsMocker.Default defaults) { super( indexBuilder, defaults ); this.entity = entity; } @@ -110,7 +110,7 @@ class EntityMocker extends AbstractEntityObjectMocker { } //@Table (entity only) - private AnnotationInstance parserTable(XMLTable table) { + private AnnotationInstance parserTable(JaxbTable table) { if ( table == null ) { return null; } @@ -159,42 +159,42 @@ class EntityMocker extends AbstractEntityObjectMocker { } @Override - protected XMLPrePersist getPrePersist() { + protected JaxbPrePersist getPrePersist() { return entity.getPrePersist(); } @Override - protected XMLPreRemove getPreRemove() { + protected JaxbPreRemove getPreRemove() { return entity.getPreRemove(); } @Override - protected XMLPreUpdate getPreUpdate() { + protected JaxbPreUpdate getPreUpdate() { return entity.getPreUpdate(); } @Override - protected XMLPostPersist getPostPersist() { + protected JaxbPostPersist getPostPersist() { return entity.getPostPersist(); } @Override - protected XMLPostUpdate getPostUpdate() { + protected JaxbPostUpdate getPostUpdate() { return entity.getPostUpdate(); } @Override - protected XMLPostRemove getPostRemove() { + protected JaxbPostRemove getPostRemove() { return entity.getPostRemove(); } @Override - protected XMLPostLoad getPostLoad() { + protected JaxbPostLoad getPostLoad() { return entity.getPostLoad(); } @Override - protected XMLAttributes getAttributes() { + protected JaxbAttributes getAttributes() { return entity.getAttributes(); } @@ -214,22 +214,22 @@ class EntityMocker extends AbstractEntityObjectMocker { } @Override - protected XMLIdClass getIdClass() { + protected JaxbIdClass getIdClass() { return entity.getIdClass(); } @Override - protected XMLEntityListeners getEntityListeners() { + protected JaxbEntityListeners getEntityListeners() { return entity.getEntityListeners(); } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return entity.getAccess(); } //@Inheritance - protected AnnotationInstance parserInheritance(XMLInheritance inheritance) { + protected AnnotationInstance parserInheritance(JaxbInheritance inheritance) { if ( inheritance == null ) { return null; } @@ -242,7 +242,7 @@ class EntityMocker extends AbstractEntityObjectMocker { } //@DiscriminatorColumn - protected AnnotationInstance parserDiscriminatorColumn(XMLDiscriminatorColumn discriminatorColumn) { + protected AnnotationInstance parserDiscriminatorColumn(JaxbDiscriminatorColumn discriminatorColumn) { if ( discriminatorColumn == null ) { return null; } @@ -264,7 +264,7 @@ class EntityMocker extends AbstractEntityObjectMocker { } //@SecondaryTable - protected AnnotationInstance parserSecondaryTable(XMLSecondaryTable secondaryTable, AnnotationTarget target) { + protected AnnotationInstance parserSecondaryTable(JaxbSecondaryTable secondaryTable, AnnotationTarget target) { if ( secondaryTable == null ) { return null; } @@ -289,7 +289,7 @@ class EntityMocker extends AbstractEntityObjectMocker { } - protected AnnotationInstance parserSecondaryTableList(List primaryKeyJoinColumnList, AnnotationTarget target) { + protected AnnotationInstance parserSecondaryTableList(List primaryKeyJoinColumnList, AnnotationTarget target) { if ( MockHelper.isNotEmpty( primaryKeyJoinColumnList ) ) { if ( primaryKeyJoinColumnList.size() == 1 ) { return parserSecondaryTable( primaryKeyJoinColumnList.get( 0 ), target ); @@ -306,7 +306,7 @@ class EntityMocker extends AbstractEntityObjectMocker { } - protected AnnotationValue[] nestedSecondaryTableList(String name, List secondaryTableList, List annotationValueList) { + protected AnnotationValue[] nestedSecondaryTableList(String name, List secondaryTableList, List annotationValueList) { if ( MockHelper.isNotEmpty( secondaryTableList ) ) { AnnotationValue[] values = new AnnotationValue[secondaryTableList.size()]; for ( int i = 0; i < secondaryTableList.size(); i++ ) { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotationMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotationMocker.java index be7320c0fd..406bf985b7 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotationMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotationMocker.java @@ -31,15 +31,15 @@ import java.util.List; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationValue; -import org.hibernate.metamodel.source.annotation.jaxb.XMLColumnResult; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityResult; -import org.hibernate.metamodel.source.annotation.jaxb.XMLFieldResult; -import org.hibernate.metamodel.source.annotation.jaxb.XMLNamedNativeQuery; -import org.hibernate.metamodel.source.annotation.jaxb.XMLNamedQuery; -import org.hibernate.metamodel.source.annotation.jaxb.XMLQueryHint; -import org.hibernate.metamodel.source.annotation.jaxb.XMLSequenceGenerator; -import org.hibernate.metamodel.source.annotation.jaxb.XMLSqlResultSetMapping; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTableGenerator; +import org.hibernate.internal.jaxb.mapping.orm.JaxbColumnResult; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityResult; +import org.hibernate.internal.jaxb.mapping.orm.JaxbFieldResult; +import org.hibernate.internal.jaxb.mapping.orm.JaxbNamedNativeQuery; +import org.hibernate.internal.jaxb.mapping.orm.JaxbNamedQuery; +import org.hibernate.internal.jaxb.mapping.orm.JaxbQueryHint; +import org.hibernate.internal.jaxb.mapping.orm.JaxbSequenceGenerator; +import org.hibernate.internal.jaxb.mapping.orm.JaxbSqlResultSetMapping; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTableGenerator; /** * @author Strong Liu @@ -55,17 +55,17 @@ class GlobalAnnotationMocker extends AbstractMocker { void process() { if ( !globalAnnotations.getTableGeneratorMap().isEmpty() ) { - for ( XMLTableGenerator generator : globalAnnotations.getTableGeneratorMap().values() ) { + for ( JaxbTableGenerator generator : globalAnnotations.getTableGeneratorMap().values() ) { parserTableGenerator( generator ); } } if ( !globalAnnotations.getSequenceGeneratorMap().isEmpty() ) { - for ( XMLSequenceGenerator generator : globalAnnotations.getSequenceGeneratorMap().values() ) { + for ( JaxbSequenceGenerator generator : globalAnnotations.getSequenceGeneratorMap().values() ) { parserSequenceGenerator( generator ); } } if ( !globalAnnotations.getNamedQueryMap().isEmpty() ) { - Collection namedQueries = globalAnnotations.getNamedQueryMap().values(); + Collection namedQueries = globalAnnotations.getNamedQueryMap().values(); if ( namedQueries.size() > 1 ) { parserNamedQueries( namedQueries ); } @@ -74,7 +74,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } } if ( !globalAnnotations.getNamedNativeQueryMap().isEmpty() ) { - Collection namedQueries = globalAnnotations.getNamedNativeQueryMap().values(); + Collection namedQueries = globalAnnotations.getNamedNativeQueryMap().values(); if ( namedQueries.size() > 1 ) { parserNamedNativeQueries( namedQueries ); } @@ -88,10 +88,10 @@ class GlobalAnnotationMocker extends AbstractMocker { indexBuilder.finishGlobalConfigurationMocking( globalAnnotations ); } - private AnnotationInstance parserSqlResultSetMappings(Collection namedQueries) { + private AnnotationInstance parserSqlResultSetMappings(Collection namedQueries) { AnnotationValue[] values = new AnnotationValue[namedQueries.size()]; int i = 0; - for ( Iterator iterator = namedQueries.iterator(); iterator.hasNext(); ) { + for ( Iterator iterator = namedQueries.iterator(); iterator.hasNext(); ) { AnnotationInstance annotationInstance = parserSqlResultSetMapping( iterator.next() ); values[i++] = MockHelper.nestedAnnotationValue( "", annotationInstance @@ -106,7 +106,7 @@ class GlobalAnnotationMocker extends AbstractMocker { //@SqlResultSetMapping - private AnnotationInstance parserSqlResultSetMapping(XMLSqlResultSetMapping mapping) { + private AnnotationInstance parserSqlResultSetMapping(JaxbSqlResultSetMapping mapping) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", mapping.getName(), annotationValueList ); @@ -121,7 +121,7 @@ class GlobalAnnotationMocker extends AbstractMocker { //@EntityResult - private AnnotationInstance parserEntityResult(XMLEntityResult result) { + private AnnotationInstance parserEntityResult(JaxbEntityResult result) { List annotationValueList = new ArrayList(); MockHelper.stringValue( @@ -138,7 +138,7 @@ class GlobalAnnotationMocker extends AbstractMocker { ); } - private void nestedEntityResultList(String name, List entityResults, List annotationValueList) { + private void nestedEntityResultList(String name, List entityResults, List annotationValueList) { if ( MockHelper.isNotEmpty( entityResults ) ) { AnnotationValue[] values = new AnnotationValue[entityResults.size()]; for ( int i = 0; i < entityResults.size(); i++ ) { @@ -154,11 +154,11 @@ class GlobalAnnotationMocker extends AbstractMocker { } //@ColumnResult - private AnnotationInstance parserColumnResult(XMLColumnResult result) { + private AnnotationInstance parserColumnResult(JaxbColumnResult result) { return create( COLUMN_RESULT, null, MockHelper.stringValueArray( "name", result.getName() ) ); } - private void nestedColumnResultList(String name, List columnResults, List annotationValueList) { + private void nestedColumnResultList(String name, List columnResults, List annotationValueList) { if ( MockHelper.isNotEmpty( columnResults ) ) { AnnotationValue[] values = new AnnotationValue[columnResults.size()]; for ( int i = 0; i < columnResults.size(); i++ ) { @@ -174,7 +174,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } //@FieldResult - private AnnotationInstance parserFieldResult(XMLFieldResult result) { + private AnnotationInstance parserFieldResult(JaxbFieldResult result) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", result.getName(), annotationValueList ); MockHelper.stringValue( "column", result.getColumn(), annotationValueList ); @@ -182,7 +182,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } - private void nestedFieldResultList(String name, List fieldResultList, List annotationValueList) { + private void nestedFieldResultList(String name, List fieldResultList, List annotationValueList) { if ( MockHelper.isNotEmpty( fieldResultList ) ) { AnnotationValue[] values = new AnnotationValue[fieldResultList.size()]; for ( int i = 0; i < fieldResultList.size(); i++ ) { @@ -197,10 +197,10 @@ class GlobalAnnotationMocker extends AbstractMocker { } } - private AnnotationInstance parserNamedNativeQueries(Collection namedQueries) { + private AnnotationInstance parserNamedNativeQueries(Collection namedQueries) { AnnotationValue[] values = new AnnotationValue[namedQueries.size()]; int i = 0; - for ( Iterator iterator = namedQueries.iterator(); iterator.hasNext(); ) { + for ( Iterator iterator = namedQueries.iterator(); iterator.hasNext(); ) { AnnotationInstance annotationInstance = parserNamedNativeQuery( iterator.next() ); values[i++] = MockHelper.nestedAnnotationValue( "", annotationInstance @@ -214,7 +214,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } //@NamedNativeQuery - private AnnotationInstance parserNamedNativeQuery(XMLNamedNativeQuery namedNativeQuery) { + private AnnotationInstance parserNamedNativeQuery(JaxbNamedNativeQuery namedNativeQuery) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", namedNativeQuery.getName(), annotationValueList ); MockHelper.stringValue( "query", namedNativeQuery.getQuery(), annotationValueList ); @@ -233,10 +233,10 @@ class GlobalAnnotationMocker extends AbstractMocker { } - private AnnotationInstance parserNamedQueries(Collection namedQueries) { + private AnnotationInstance parserNamedQueries(Collection namedQueries) { AnnotationValue[] values = new AnnotationValue[namedQueries.size()]; int i = 0; - for ( Iterator iterator = namedQueries.iterator(); iterator.hasNext(); ) { + for ( Iterator iterator = namedQueries.iterator(); iterator.hasNext(); ) { AnnotationInstance annotationInstance = parserNamedQuery( iterator.next() ); values[i++] = MockHelper.nestedAnnotationValue( "", annotationInstance @@ -251,7 +251,7 @@ class GlobalAnnotationMocker extends AbstractMocker { //@NamedQuery - private AnnotationInstance parserNamedQuery(XMLNamedQuery namedQuery) { + private AnnotationInstance parserNamedQuery(JaxbNamedQuery namedQuery) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", namedQuery.getName(), annotationValueList ); MockHelper.stringValue( "query", namedQuery.getQuery(), annotationValueList ); @@ -261,7 +261,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } //@QueryHint - private AnnotationInstance parserQueryHint(XMLQueryHint queryHint) { + private AnnotationInstance parserQueryHint(JaxbQueryHint queryHint) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", queryHint.getName(), annotationValueList ); MockHelper.stringValue( "value", queryHint.getValue(), annotationValueList ); @@ -269,7 +269,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } - private void nestedQueryHintList(String name, List constraints, List annotationValueList) { + private void nestedQueryHintList(String name, List constraints, List annotationValueList) { if ( MockHelper.isNotEmpty( constraints ) ) { AnnotationValue[] values = new AnnotationValue[constraints.size()]; for ( int i = 0; i < constraints.size(); i++ ) { @@ -286,7 +286,7 @@ class GlobalAnnotationMocker extends AbstractMocker { //@SequenceGenerator - private AnnotationInstance parserSequenceGenerator(XMLSequenceGenerator generator) { + private AnnotationInstance parserSequenceGenerator(JaxbSequenceGenerator generator) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", generator.getName(), annotationValueList ); MockHelper.stringValue( "catalog", generator.getCatalog(), annotationValueList ); @@ -302,7 +302,7 @@ class GlobalAnnotationMocker extends AbstractMocker { } //@TableGenerator - private AnnotationInstance parserTableGenerator(XMLTableGenerator generator) { + private AnnotationInstance parserTableGenerator(JaxbTableGenerator generator) { List annotationValueList = new ArrayList(); MockHelper.stringValue( "name", generator.getName(), annotationValueList ); MockHelper.stringValue( "catalog", generator.getCatalog(), annotationValueList ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotations.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotations.java index 79aba78350..87eb6846de 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotations.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/GlobalAnnotations.java @@ -38,15 +38,15 @@ import org.jboss.logging.Logger; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.source.MappingException; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityMappings; -import org.hibernate.metamodel.source.annotation.jaxb.XMLId; -import org.hibernate.metamodel.source.annotation.jaxb.XMLNamedNativeQuery; -import org.hibernate.metamodel.source.annotation.jaxb.XMLNamedQuery; -import org.hibernate.metamodel.source.annotation.jaxb.XMLSequenceGenerator; -import org.hibernate.metamodel.source.annotation.jaxb.XMLSqlResultSetMapping; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTableGenerator; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings; +import org.hibernate.internal.jaxb.mapping.orm.JaxbId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbNamedNativeQuery; +import org.hibernate.internal.jaxb.mapping.orm.JaxbNamedQuery; +import org.hibernate.internal.jaxb.mapping.orm.JaxbSequenceGenerator; +import org.hibernate.internal.jaxb.mapping.orm.JaxbSqlResultSetMapping; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTableGenerator; import org.hibernate.metamodel.source.annotations.JPADotNames; /** @@ -57,11 +57,11 @@ class GlobalAnnotations implements JPADotNames { CoreMessageLogger.class, GlobalAnnotations.class.getName() ); - private Map sequenceGeneratorMap = new HashMap(); - private Map tableGeneratorMap = new HashMap(); - private Map namedQueryMap = new HashMap(); - private Map namedNativeQueryMap = new HashMap(); - private Map sqlResultSetMappingMap = new HashMap(); + private Map sequenceGeneratorMap = new HashMap(); + private Map tableGeneratorMap = new HashMap(); + private Map namedQueryMap = new HashMap(); + private Map namedNativeQueryMap = new HashMap(); + private Map sqlResultSetMappingMap = new HashMap(); private Map> annotationInstanceMap = new HashMap>(); private List indexedAnnotationInstanceList = new ArrayList(); //--------------------------- @@ -102,23 +102,23 @@ class GlobalAnnotations implements JPADotNames { .isEmpty() && sqlResultSetMappingMap.isEmpty() ); } - Map getNamedNativeQueryMap() { + Map getNamedNativeQueryMap() { return namedNativeQueryMap; } - Map getNamedQueryMap() { + Map getNamedQueryMap() { return namedQueryMap; } - Map getSequenceGeneratorMap() { + Map getSequenceGeneratorMap() { return sequenceGeneratorMap; } - Map getSqlResultSetMappingMap() { + Map getSqlResultSetMappingMap() { return sqlResultSetMappingMap; } - Map getTableGeneratorMap() { + Map getTableGeneratorMap() { return tableGeneratorMap; } @@ -152,31 +152,31 @@ class GlobalAnnotations implements JPADotNames { } } - void collectGlobalMappings(XMLEntityMappings entityMappings, EntityMappingsMocker.Default defaults) { - for ( XMLSequenceGenerator generator : entityMappings.getSequenceGenerator() ) { + void collectGlobalMappings(JaxbEntityMappings entityMappings, EntityMappingsMocker.Default defaults) { + for ( JaxbSequenceGenerator generator : entityMappings.getSequenceGenerator() ) { put( generator, defaults ); defaultNamedGenerators.add( generator.getName() ); } - for ( XMLTableGenerator generator : entityMappings.getTableGenerator() ) { + for ( JaxbTableGenerator generator : entityMappings.getTableGenerator() ) { put( generator, defaults ); defaultNamedGenerators.add( generator.getName() ); } - for ( XMLNamedQuery namedQuery : entityMappings.getNamedQuery() ) { + for ( JaxbNamedQuery namedQuery : entityMappings.getNamedQuery() ) { put( namedQuery ); defaultNamedQueryNames.add( namedQuery.getName() ); } - for ( XMLNamedNativeQuery namedNativeQuery : entityMappings.getNamedNativeQuery() ) { + for ( JaxbNamedNativeQuery namedNativeQuery : entityMappings.getNamedNativeQuery() ) { put( namedNativeQuery ); defaultNamedNativeQueryNames.add( namedNativeQuery.getName() ); } - for ( XMLSqlResultSetMapping sqlResultSetMapping : entityMappings.getSqlResultSetMapping() ) { + for ( JaxbSqlResultSetMapping sqlResultSetMapping : entityMappings.getSqlResultSetMapping() ) { put( sqlResultSetMapping ); defaultSqlResultSetMappingNames.add( sqlResultSetMapping.getName() ); } } - void collectGlobalMappings(XMLEntity entity, EntityMappingsMocker.Default defaults) { - for ( XMLNamedQuery namedQuery : entity.getNamedQuery() ) { + void collectGlobalMappings(JaxbEntity entity, EntityMappingsMocker.Default defaults) { + for ( JaxbNamedQuery namedQuery : entity.getNamedQuery() ) { if ( !defaultNamedQueryNames.contains( namedQuery.getName() ) ) { put( namedQuery ); } @@ -184,7 +184,7 @@ class GlobalAnnotations implements JPADotNames { LOG.warn( "Named Query [" + namedQuery.getName() + "] duplicated." ); } } - for ( XMLNamedNativeQuery namedNativeQuery : entity.getNamedNativeQuery() ) { + for ( JaxbNamedNativeQuery namedNativeQuery : entity.getNamedNativeQuery() ) { if ( !defaultNamedNativeQueryNames.contains( namedNativeQuery.getName() ) ) { put( namedNativeQuery ); } @@ -192,26 +192,26 @@ class GlobalAnnotations implements JPADotNames { LOG.warn( "Named native Query [" + namedNativeQuery.getName() + "] duplicated." ); } } - for ( XMLSqlResultSetMapping sqlResultSetMapping : entity.getSqlResultSetMapping() ) { + for ( JaxbSqlResultSetMapping sqlResultSetMapping : entity.getSqlResultSetMapping() ) { if ( !defaultSqlResultSetMappingNames.contains( sqlResultSetMapping.getName() ) ) { put( sqlResultSetMapping ); } } - XMLSequenceGenerator sequenceGenerator = entity.getSequenceGenerator(); + JaxbSequenceGenerator sequenceGenerator = entity.getSequenceGenerator(); if ( sequenceGenerator != null ) { if ( !defaultNamedGenerators.contains( sequenceGenerator.getName() ) ) { put( sequenceGenerator, defaults ); } } - XMLTableGenerator tableGenerator = entity.getTableGenerator(); + JaxbTableGenerator tableGenerator = entity.getTableGenerator(); if ( tableGenerator != null ) { if ( !defaultNamedGenerators.contains( tableGenerator.getName() ) ) { put( tableGenerator, defaults ); } } - XMLAttributes attributes = entity.getAttributes(); + JaxbAttributes attributes = entity.getAttributes(); if ( attributes != null ) { - for ( XMLId id : attributes.getId() ) { + for ( JaxbId id : attributes.getId() ) { sequenceGenerator = id.getSequenceGenerator(); if ( sequenceGenerator != null ) { put( sequenceGenerator, defaults ); @@ -227,7 +227,7 @@ class GlobalAnnotations implements JPADotNames { /** * Override SequenceGenerator using info definded in EntityMappings/Persistence-Metadata-Unit */ - private static XMLSequenceGenerator overrideGenerator(XMLSequenceGenerator generator, EntityMappingsMocker.Default defaults) { + private static JaxbSequenceGenerator overrideGenerator(JaxbSequenceGenerator generator, EntityMappingsMocker.Default defaults) { if ( StringHelper.isEmpty( generator.getSchema() ) && defaults != null ) { generator.setSchema( defaults.getSchema() ); } @@ -240,7 +240,7 @@ class GlobalAnnotations implements JPADotNames { /** * Override TableGenerator using info definded in EntityMappings/Persistence-Metadata-Unit */ - private static XMLTableGenerator overrideGenerator(XMLTableGenerator generator, EntityMappingsMocker.Default defaults) { + private static JaxbTableGenerator overrideGenerator(JaxbTableGenerator generator, EntityMappingsMocker.Default defaults) { if ( StringHelper.isEmpty( generator.getSchema() ) && defaults != null ) { generator.setSchema( defaults.getSchema() ); } @@ -250,7 +250,7 @@ class GlobalAnnotations implements JPADotNames { return generator; } - private void put(XMLNamedNativeQuery query) { + private void put(JaxbNamedNativeQuery query) { if ( query != null ) { checkQueryName( query.getName() ); namedNativeQueryMap.put( query.getName(), query ); @@ -263,14 +263,14 @@ class GlobalAnnotations implements JPADotNames { } } - private void put(XMLNamedQuery query) { + private void put(JaxbNamedQuery query) { if ( query != null ) { checkQueryName( query.getName() ); namedQueryMap.put( query.getName(), query ); } } - private void put(XMLSequenceGenerator generator, EntityMappingsMocker.Default defaults) { + private void put(JaxbSequenceGenerator generator, EntityMappingsMocker.Default defaults) { if ( generator != null ) { Object old = sequenceGeneratorMap.put( generator.getName(), overrideGenerator( generator, defaults ) ); if ( old != null ) { @@ -279,7 +279,7 @@ class GlobalAnnotations implements JPADotNames { } } - private void put(XMLTableGenerator generator, EntityMappingsMocker.Default defaults) { + private void put(JaxbTableGenerator generator, EntityMappingsMocker.Default defaults) { if ( generator != null ) { Object old = tableGeneratorMap.put( generator.getName(), overrideGenerator( generator, defaults ) ); if ( old != null ) { @@ -288,7 +288,7 @@ class GlobalAnnotations implements JPADotNames { } } - private void put(XMLSqlResultSetMapping mapping) { + private void put(JaxbSqlResultSetMapping mapping) { if ( mapping != null ) { Object old = sqlResultSetMappingMap.put( mapping.getName(), mapping ); if ( old != null ) { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/IdMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/IdMocker.java index e26bc9fd6c..1708bab52d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/IdMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/IdMocker.java @@ -31,17 +31,17 @@ import org.jboss.jandex.AnnotationTarget; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLGeneratedValue; -import org.hibernate.metamodel.source.annotation.jaxb.XMLId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbGeneratedValue; +import org.hibernate.internal.jaxb.mapping.orm.JaxbId; /** * @author Strong Liu */ class IdMocker extends PropertyMocker { - private XMLId id; + private JaxbId id; - IdMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLId id) { + IdMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbId id) { super( indexBuilder, classInfo, defaults ); this.id = id; } @@ -54,7 +54,7 @@ class IdMocker extends PropertyMocker { parserTemporalType( id.getTemporal(), getTarget() ); } - private AnnotationInstance parserGeneratedValue(XMLGeneratedValue generatedValue, AnnotationTarget target) { + private AnnotationInstance parserGeneratedValue(JaxbGeneratedValue generatedValue, AnnotationTarget target) { if ( generatedValue == null ) { return null; } @@ -73,12 +73,12 @@ class IdMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return id.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { id.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ListenerMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ListenerMocker.java index 9cce58d2dd..02c2945c28 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ListenerMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ListenerMocker.java @@ -32,15 +32,15 @@ import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; import org.hibernate.MappingException; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityListener; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityListeners; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostLoad; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostPersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostUpdate; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPrePersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityListener; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityListeners; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostLoad; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostPersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPrePersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreUpdate; /** * {@link javax.persistence.EntityListeners @EntityListeners} mocker @@ -55,13 +55,13 @@ class ListenerMocker extends AbstractMocker { this.classInfo = classInfo; } - AnnotationInstance parser(XMLEntityListeners entityListeners) { + AnnotationInstance parser(JaxbEntityListeners entityListeners) { if ( entityListeners.getEntityListener().isEmpty() ) { throw new MappingException( "No child element of found under ." ); } List annotationValueList = new ArrayList( 1 ); List clazzNameList = new ArrayList( entityListeners.getEntityListener().size() ); - for ( XMLEntityListener listener : entityListeners.getEntityListener() ) { + for ( JaxbEntityListener listener : entityListeners.getEntityListener() ) { MockHelper.addToCollectionIfNotNull( clazzNameList, listener.getClazz() ); parserEntityListener( listener ); } @@ -69,7 +69,7 @@ class ListenerMocker extends AbstractMocker { return create( ENTITY_LISTENERS, classInfo, annotationValueList ); } - private void parserEntityListener(XMLEntityListener listener) { + private void parserEntityListener(JaxbEntityListener listener) { String clazz = listener.getClazz(); ClassInfo tempClassInfo = indexBuilder.createClassInfo( clazz ); ListenerMocker mocker = createListenerMocker( indexBuilder, tempClassInfo ); @@ -88,7 +88,7 @@ class ListenerMocker extends AbstractMocker { } //@PrePersist - AnnotationInstance parser(XMLPrePersist callback) { + AnnotationInstance parser(JaxbPrePersist callback) { if ( callback == null ) { return null; } @@ -96,7 +96,7 @@ class ListenerMocker extends AbstractMocker { } //@PreRemove - AnnotationInstance parser(XMLPreRemove callback) { + AnnotationInstance parser(JaxbPreRemove callback) { if ( callback == null ) { return null; } @@ -104,7 +104,7 @@ class ListenerMocker extends AbstractMocker { } //@PreUpdate - AnnotationInstance parser(XMLPreUpdate callback) { + AnnotationInstance parser(JaxbPreUpdate callback) { if ( callback == null ) { return null; } @@ -112,7 +112,7 @@ class ListenerMocker extends AbstractMocker { } //@PostPersist - AnnotationInstance parser(XMLPostPersist callback) { + AnnotationInstance parser(JaxbPostPersist callback) { if ( callback == null ) { return null; } @@ -120,7 +120,7 @@ class ListenerMocker extends AbstractMocker { } //@PostUpdate - AnnotationInstance parser(XMLPostUpdate callback) { + AnnotationInstance parser(JaxbPostUpdate callback) { if ( callback == null ) { return null; } @@ -128,7 +128,7 @@ class ListenerMocker extends AbstractMocker { } //@PostRemove - AnnotationInstance parser(XMLPostRemove callback) { + AnnotationInstance parser(JaxbPostRemove callback) { if ( callback == null ) { return null; } @@ -136,7 +136,7 @@ class ListenerMocker extends AbstractMocker { } //@PostLoad - AnnotationInstance parser(XMLPostLoad callback) { + AnnotationInstance parser(JaxbPostLoad callback) { if ( callback == null ) { return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToManyMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToManyMocker.java index 269992d64c..65fe8c2b7a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToManyMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToManyMocker.java @@ -29,16 +29,16 @@ import java.util.List; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToMany; /** * @author Strong Liu */ class ManyToManyMocker extends PropertyMocker { - private XMLManyToMany manyToMany; + private JaxbManyToMany manyToMany; - ManyToManyMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLManyToMany manyToMany) { + ManyToManyMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbManyToMany manyToMany) { super( indexBuilder, classInfo, defaults ); this.manyToMany = manyToMany; } @@ -73,12 +73,12 @@ class ManyToManyMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return manyToMany.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { manyToMany.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToOneMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToOneMocker.java index db46e85d2a..c6c1cc96e0 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToOneMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/ManyToOneMocker.java @@ -29,16 +29,16 @@ import java.util.List; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLManyToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbManyToOne; /** * @author Strong Liu */ class ManyToOneMocker extends PropertyMocker { - private XMLManyToOne manyToOne; + private JaxbManyToOne manyToOne; - ManyToOneMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLManyToOne manyToOne) { + ManyToOneMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbManyToOne manyToOne) { super( indexBuilder, classInfo, defaults ); this.manyToOne = manyToOne; } @@ -69,12 +69,12 @@ class ManyToOneMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return manyToOne.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { manyToOne.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MappedSuperclassMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MappedSuperclassMocker.java index ebb46e2af1..efc5ae7482 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MappedSuperclassMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MappedSuperclassMocker.java @@ -26,18 +26,18 @@ package org.hibernate.metamodel.source.annotations.xml.mocker; import org.jboss.logging.Logger; import org.hibernate.internal.CoreMessageLogger; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityListeners; -import org.hibernate.metamodel.source.annotation.jaxb.XMLIdClass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMappedSuperclass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostLoad; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostPersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPostUpdate; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPrePersist; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreRemove; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPreUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityListeners; +import org.hibernate.internal.jaxb.mapping.orm.JaxbIdClass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMappedSuperclass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostLoad; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostPersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPostUpdate; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPrePersist; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreRemove; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPreUpdate; /** * Mock to {@link javax.persistence.MappedSuperclass @MappedSuperClass} @@ -49,9 +49,9 @@ class MappedSuperclassMocker extends AbstractEntityObjectMocker { CoreMessageLogger.class, MappedSuperclassMocker.class.getName() ); - private XMLMappedSuperclass mappedSuperclass; + private JaxbMappedSuperclass mappedSuperclass; - MappedSuperclassMocker(IndexBuilder indexBuilder, XMLMappedSuperclass mappedSuperclass, EntityMappingsMocker.Default defaults) { + MappedSuperclassMocker(IndexBuilder indexBuilder, JaxbMappedSuperclass mappedSuperclass, EntityMappingsMocker.Default defaults) { super( indexBuilder, defaults ); this.mappedSuperclass = mappedSuperclass; } @@ -67,12 +67,12 @@ class MappedSuperclassMocker extends AbstractEntityObjectMocker { } @Override - protected XMLAttributes getAttributes() { + protected JaxbAttributes getAttributes() { return mappedSuperclass.getAttributes(); } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return mappedSuperclass.getAccess(); } @@ -92,12 +92,12 @@ class MappedSuperclassMocker extends AbstractEntityObjectMocker { } @Override - protected XMLIdClass getIdClass() { + protected JaxbIdClass getIdClass() { return mappedSuperclass.getIdClass(); } @Override - protected XMLEntityListeners getEntityListeners() { + protected JaxbEntityListeners getEntityListeners() { return mappedSuperclass.getEntityListeners(); } @@ -106,37 +106,37 @@ class MappedSuperclassMocker extends AbstractEntityObjectMocker { } @Override - protected XMLPrePersist getPrePersist() { + protected JaxbPrePersist getPrePersist() { return mappedSuperclass.getPrePersist(); } @Override - protected XMLPreRemove getPreRemove() { + protected JaxbPreRemove getPreRemove() { return mappedSuperclass.getPreRemove(); } @Override - protected XMLPreUpdate getPreUpdate() { + protected JaxbPreUpdate getPreUpdate() { return mappedSuperclass.getPreUpdate(); } @Override - protected XMLPostPersist getPostPersist() { + protected JaxbPostPersist getPostPersist() { return mappedSuperclass.getPostPersist(); } @Override - protected XMLPostUpdate getPostUpdate() { + protected JaxbPostUpdate getPostUpdate() { return mappedSuperclass.getPostUpdate(); } @Override - protected XMLPostRemove getPostRemove() { + protected JaxbPostRemove getPostRemove() { return mappedSuperclass.getPostRemove(); } @Override - protected XMLPostLoad getPostLoad() { + protected JaxbPostLoad getPostLoad() { return mappedSuperclass.getPostLoad(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MockHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MockHelper.java index 9e8b96c71c..502b7ee133 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MockHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/MockHelper.java @@ -41,7 +41,7 @@ import org.jboss.jandex.Type; import org.hibernate.HibernateException; import org.hibernate.internal.util.StringHelper; -import org.hibernate.metamodel.source.annotation.jaxb.XMLCascadeType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbCascadeType; import org.hibernate.metamodel.source.annotations.JPADotNames; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.classloading.spi.ClassLoaderService; @@ -185,7 +185,7 @@ public class MockHelper { return null; } - static void cascadeValue(String name, XMLCascadeType cascadeType, boolean isCascadePersistDefault, List annotationValueList) { + static void cascadeValue(String name, JaxbCascadeType cascadeType, boolean isCascadePersistDefault, List annotationValueList) { List enumList = new ArrayList(); if ( isCascadePersistDefault ) { enumList.add( javax.persistence.CascadeType.PERSIST ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToManyMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToManyMocker.java index d537311eee..88703e8f1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToManyMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToManyMocker.java @@ -29,16 +29,16 @@ import java.util.List; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToMany; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToMany; /** * @author Strong Liu */ class OneToManyMocker extends PropertyMocker { - private XMLOneToMany oneToMany; + private JaxbOneToMany oneToMany; - OneToManyMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLOneToMany oneToMany) { + OneToManyMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbOneToMany oneToMany) { super( indexBuilder, classInfo, defaults ); this.oneToMany = oneToMany; } @@ -75,12 +75,12 @@ class OneToManyMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return oneToMany.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { oneToMany.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToOneMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToOneMocker.java index f60e198363..6cd21f2574 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToOneMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/OneToOneMocker.java @@ -29,16 +29,16 @@ import java.util.List; import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLOneToOne; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbOneToOne; /** * @author Strong Liu */ class OneToOneMocker extends PropertyMocker { - private XMLOneToOne oneToOne; + private JaxbOneToOne oneToOne; - OneToOneMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLOneToOne oneToOne) { + OneToOneMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbOneToOne oneToOne) { super( indexBuilder, classInfo, defaults ); this.oneToOne = oneToOne; } @@ -73,12 +73,12 @@ class OneToOneMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return oneToOne.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { oneToOne.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PersistenceMetadataMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PersistenceMetadataMocker.java index 52fed81ec2..8a86167722 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PersistenceMetadataMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PersistenceMetadataMocker.java @@ -10,13 +10,13 @@ import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; import org.hibernate.metamodel.source.annotations.xml.PseudoJpaDotNames; -import org.hibernate.metamodel.source.annotation.jaxb.XMLPersistenceUnitDefaults; +import org.hibernate.internal.jaxb.mapping.orm.JaxbPersistenceUnitDefaults; /** * @author Strong Liu */ class PersistenceMetadataMocker extends AbstractMocker { - private final XMLPersistenceUnitDefaults persistenceUnitDefaults; + private final JaxbPersistenceUnitDefaults persistenceUnitDefaults; private final GlobalAnnotations globalAnnotations = new GlobalAnnotations(); /** * Map JPA Annotations name to Pseudo JPA Annotations name. @@ -39,7 +39,7 @@ class PersistenceMetadataMocker extends AbstractMocker { ); } - PersistenceMetadataMocker(IndexBuilder indexBuilder, XMLPersistenceUnitDefaults persistenceUnitDefaults) { + PersistenceMetadataMocker(IndexBuilder indexBuilder, JaxbPersistenceUnitDefaults persistenceUnitDefaults) { super( indexBuilder ); this.persistenceUnitDefaults = persistenceUnitDefaults; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PropertyMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PropertyMocker.java index c2d0dee299..82873bc2c0 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PropertyMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/PropertyMocker.java @@ -33,13 +33,13 @@ import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; import org.hibernate.HibernateException; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEnumType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMapKey; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMapKeyClass; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMapKeyColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLMapKeyJoinColumn; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTemporalType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEnumType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMapKey; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMapKeyClass; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMapKeyColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbMapKeyJoinColumn; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTemporalType; /** * @author Strong Liu @@ -57,9 +57,9 @@ abstract class PropertyMocker extends AnnotationMocker { protected abstract String getFieldName(); - protected abstract XMLAccessType getAccessType(); + protected abstract JaxbAccessType getAccessType(); - protected abstract void setAccessType(XMLAccessType accessType); + protected abstract void setAccessType(JaxbAccessType accessType); @Override protected DotName getTargetName() { @@ -68,7 +68,7 @@ abstract class PropertyMocker extends AnnotationMocker { protected void resolveTarget() { //attribute in orm.xml has access sub-element - XMLAccessType accessType = getAccessType(); + JaxbAccessType accessType = getAccessType(); if ( accessType == null ) { //attribute in the entity class has @Access accessType = AccessHelper.getAccessFromAttributeAnnotation( getTargetName(), getFieldName(), indexBuilder ); @@ -83,7 +83,7 @@ abstract class PropertyMocker extends AnnotationMocker { accessType = AccessHelper.getAccessFromDefault( indexBuilder ); } if ( accessType == null ) { - accessType = XMLAccessType.PROPERTY; + accessType = JaxbAccessType.PROPERTY; } setAccessType( accessType ); @@ -99,7 +99,7 @@ abstract class PropertyMocker extends AnnotationMocker { return target; } - protected AnnotationTarget getTargetFromAttributeAccessType(XMLAccessType accessType) { + protected AnnotationTarget getTargetFromAttributeAccessType(JaxbAccessType accessType) { if ( accessType == null ) { throw new IllegalArgumentException( "access type can't be null." ); } @@ -130,7 +130,7 @@ abstract class PropertyMocker extends AnnotationMocker { processExtra(); } - protected AnnotationInstance parserMapKeyColumn(XMLMapKeyColumn mapKeyColumn, AnnotationTarget target) { + protected AnnotationInstance parserMapKeyColumn(JaxbMapKeyColumn mapKeyColumn, AnnotationTarget target) { if ( mapKeyColumn == null ) { return null; } @@ -148,7 +148,7 @@ abstract class PropertyMocker extends AnnotationMocker { return create( MAP_KEY_COLUMN, target, annotationValueList ); } - protected AnnotationInstance parserMapKeyClass(XMLMapKeyClass mapKeyClass, AnnotationTarget target) { + protected AnnotationInstance parserMapKeyClass(JaxbMapKeyClass mapKeyClass, AnnotationTarget target) { if ( mapKeyClass == null ) { return null; } @@ -159,7 +159,7 @@ abstract class PropertyMocker extends AnnotationMocker { ); } - protected AnnotationInstance parserMapKeyTemporal(XMLTemporalType temporalType, AnnotationTarget target) { + protected AnnotationInstance parserMapKeyTemporal(JaxbTemporalType temporalType, AnnotationTarget target) { if ( temporalType == null ) { return null; } @@ -169,7 +169,7 @@ abstract class PropertyMocker extends AnnotationMocker { ); } - protected AnnotationInstance parserMapKeyEnumerated(XMLEnumType enumType, AnnotationTarget target) { + protected AnnotationInstance parserMapKeyEnumerated(JaxbEnumType enumType, AnnotationTarget target) { if ( enumType == null ) { return null; } @@ -179,14 +179,14 @@ abstract class PropertyMocker extends AnnotationMocker { ); } - protected AnnotationInstance parserMapKey(XMLMapKey mapKey, AnnotationTarget target) { + protected AnnotationInstance parserMapKey(JaxbMapKey mapKey, AnnotationTarget target) { if ( mapKey == null ) { return null; } return create( MAP_KEY, target, MockHelper.stringValueArray( "name", mapKey.getName() ) ); } - private AnnotationValue[] nestedMapKeyJoinColumnList(String name, List columns, List annotationValueList) { + private AnnotationValue[] nestedMapKeyJoinColumnList(String name, List columns, List annotationValueList) { if ( MockHelper.isNotEmpty( columns ) ) { AnnotationValue[] values = new AnnotationValue[columns.size()]; for ( int i = 0; i < columns.size(); i++ ) { @@ -203,7 +203,7 @@ abstract class PropertyMocker extends AnnotationMocker { return MockHelper.EMPTY_ANNOTATION_VALUE_ARRAY; } - protected AnnotationInstance parserMapKeyJoinColumnList(List joinColumnList, AnnotationTarget target) { + protected AnnotationInstance parserMapKeyJoinColumnList(List joinColumnList, AnnotationTarget target) { if ( MockHelper.isNotEmpty( joinColumnList ) ) { if ( joinColumnList.size() == 1 ) { return parserMapKeyJoinColumn( joinColumnList.get( 0 ), target ); @@ -222,7 +222,7 @@ abstract class PropertyMocker extends AnnotationMocker { } //@MapKeyJoinColumn - private AnnotationInstance parserMapKeyJoinColumn(XMLMapKeyJoinColumn column, AnnotationTarget target) { + private AnnotationInstance parserMapKeyJoinColumn(JaxbMapKeyJoinColumn column, AnnotationTarget target) { if ( column == null ) { return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/SchemaAware.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/SchemaAware.java index 49ee82765f..d276b6d1aa 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/SchemaAware.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/SchemaAware.java @@ -23,10 +23,10 @@ */ package org.hibernate.metamodel.source.annotations.xml.mocker; -import org.hibernate.metamodel.source.annotation.jaxb.XMLCollectionTable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLJoinTable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLSecondaryTable; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbCollectionTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbJoinTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbSecondaryTable; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTable; /** * @author Strong Liu @@ -41,9 +41,9 @@ interface SchemaAware { void setCatalog(String catalog); static class SecondaryTableSchemaAware implements SchemaAware { - private XMLSecondaryTable table; + private JaxbSecondaryTable table; - SecondaryTableSchemaAware(XMLSecondaryTable table) { + SecondaryTableSchemaAware(JaxbSecondaryTable table) { this.table = table; } @@ -69,9 +69,9 @@ interface SchemaAware { } static class TableSchemaAware implements SchemaAware { - private XMLTable table; + private JaxbTable table; - public TableSchemaAware(XMLTable table) { + public TableSchemaAware(JaxbTable table) { this.table = table; } @@ -97,9 +97,9 @@ interface SchemaAware { } static class JoinTableSchemaAware implements SchemaAware { - private XMLJoinTable table; + private JaxbJoinTable table; - public JoinTableSchemaAware(XMLJoinTable table) { + public JoinTableSchemaAware(JaxbJoinTable table) { this.table = table; } @@ -125,9 +125,9 @@ interface SchemaAware { } static class CollectionTableSchemaAware implements SchemaAware { - private XMLCollectionTable table; + private JaxbCollectionTable table; - public CollectionTableSchemaAware(XMLCollectionTable table) { + public CollectionTableSchemaAware(JaxbCollectionTable table) { this.table = table; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/TransientMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/TransientMocker.java index e2b0ee8b1c..790dc80d14 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/TransientMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/TransientMocker.java @@ -25,16 +25,16 @@ package org.hibernate.metamodel.source.annotations.xml.mocker; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLTransient; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbTransient; /** * @author Strong Liu */ class TransientMocker extends PropertyMocker { - private XMLTransient transientObj; + private JaxbTransient transientObj; - TransientMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLTransient transientObj) { + TransientMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbTransient transientObj) { super( indexBuilder, classInfo, defaults ); this.transientObj = transientObj; } @@ -50,12 +50,12 @@ class TransientMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { - return XMLAccessType.FIELD; + protected JaxbAccessType getAccessType() { + return JaxbAccessType.FIELD; } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { //ignore } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/VersionMocker.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/VersionMocker.java index fe13d95625..f4b633d9f7 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/VersionMocker.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/VersionMocker.java @@ -25,16 +25,16 @@ package org.hibernate.metamodel.source.annotations.xml.mocker; import org.jboss.jandex.ClassInfo; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAccessType; -import org.hibernate.metamodel.source.annotation.jaxb.XMLVersion; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAccessType; +import org.hibernate.internal.jaxb.mapping.orm.JaxbVersion; /** * @author Strong Liu */ class VersionMocker extends PropertyMocker { - private XMLVersion version; + private JaxbVersion version; - VersionMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, XMLVersion version) { + VersionMocker(IndexBuilder indexBuilder, ClassInfo classInfo, EntityMappingsMocker.Default defaults, JaxbVersion version) { super( indexBuilder, classInfo, defaults ); this.version = version; } @@ -52,12 +52,12 @@ class VersionMocker extends PropertyMocker { } @Override - protected XMLAccessType getAccessType() { + protected JaxbAccessType getAccessType() { return version.getAccess(); } @Override - protected void setAccessType(XMLAccessType accessType) { + protected void setAccessType(JaxbAccessType accessType) { version.setAccess( accessType ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/binder/EntitySource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/binder/EntitySource.java index c209234e28..f118d9c49e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/binder/EntitySource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/binder/EntitySource.java @@ -27,9 +27,10 @@ import java.util.List; import javax.persistence.Entity; import javax.persistence.EntityListeners; import javax.persistence.MappedSuperclass; + +import org.hibernate.internal.jaxb.Origin; import org.hibernate.metamodel.binding.CustomSQL; import org.hibernate.metamodel.source.LocalBindingContext; -import org.hibernate.metamodel.source.Origin; /** * Contract describing source of an entity diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractEntitySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractEntitySourceImpl.java index 5473b95a8c..e5edbde283 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractEntitySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractEntitySourceImpl.java @@ -29,10 +29,10 @@ import java.util.List; import org.hibernate.AssertionFailure; import org.hibernate.EntityMode; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.binding.CustomSQL; import org.hibernate.metamodel.source.LocalBindingContext; -import org.hibernate.metamodel.source.Origin; import org.hibernate.metamodel.source.binder.AttributeSource; import org.hibernate.metamodel.source.binder.ConstraintSource; import org.hibernate.metamodel.source.binder.EntitySource; @@ -40,19 +40,19 @@ import org.hibernate.metamodel.source.binder.JpaCallbackClass; import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.SubclassEntitySource; import org.hibernate.metamodel.source.binder.TableSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLAnyElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLBagElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLComponentElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLIdbagElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLListElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLManyToOneElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLMapElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLOneToOneElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLPropertyElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSetElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSynchronizeElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLTuplizerElement; +import org.hibernate.internal.jaxb.mapping.hbm.EntityElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbAnyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbBagElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbComponentElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbIdbagElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbListElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbManyToOneElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbMapElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbOneToOneElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbPropertyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSetElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSynchronizeElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbTuplizerElement; /** * @author Steve Ebersole @@ -149,7 +149,7 @@ public abstract class AbstractEntitySourceImpl implements EntitySource { return null; } final EntityMode entityMode = determineEntityMode(); - for ( XMLTuplizerElement tuplizerElement : entityElement.getTuplizer() ) { + for ( JaxbTuplizerElement tuplizerElement : entityElement.getTuplizer() ) { if ( entityMode == EntityMode.parse( tuplizerElement.getEntityMode() ) ) { return tuplizerElement.getClazz(); } @@ -185,7 +185,7 @@ public abstract class AbstractEntitySourceImpl implements EntitySource { @Override public List getSynchronizedTableNames() { List tableNames = new ArrayList(); - for ( XMLSynchronizeElement synchronizeElement : entityElement.getSynchronize() ) { + for ( JaxbSynchronizeElement synchronizeElement : entityElement.getSynchronize() ) { tableNames.add( synchronizeElement.getTable() ); } return tableNames; @@ -205,60 +205,60 @@ public abstract class AbstractEntitySourceImpl implements EntitySource { public Iterable attributeSources() { List attributeSources = new ArrayList(); for ( Object attributeElement : entityElement.getPropertyOrManyToOneOrOneToOne() ) { - if ( XMLPropertyElement.class.isInstance( attributeElement ) ) { + if ( JaxbPropertyElement.class.isInstance( attributeElement ) ) { attributeSources.add( new PropertyAttributeSourceImpl( - XMLPropertyElement.class.cast( attributeElement ), + JaxbPropertyElement.class.cast( attributeElement ), sourceMappingDocument().getMappingLocalBindingContext() ) ); } - else if ( XMLComponentElement.class.isInstance( attributeElement ) ) { + else if ( JaxbComponentElement.class.isInstance( attributeElement ) ) { attributeSources.add( new ComponentAttributeSourceImpl( - (XMLComponentElement) attributeElement, + (JaxbComponentElement) attributeElement, this, sourceMappingDocument.getMappingLocalBindingContext() ) ); } - else if ( XMLManyToOneElement.class.isInstance( attributeElement ) ) { + else if ( JaxbManyToOneElement.class.isInstance( attributeElement ) ) { attributeSources.add( new ManyToOneAttributeSourceImpl( - XMLManyToOneElement.class.cast( attributeElement ), + JaxbManyToOneElement.class.cast( attributeElement ), sourceMappingDocument().getMappingLocalBindingContext() ) ); } - else if ( XMLOneToOneElement.class.isInstance( attributeElement ) ) { + else if ( JaxbOneToOneElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLAnyElement.class.isInstance( attributeElement ) ) { + else if ( JaxbAnyElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLBagElement.class.isInstance( attributeElement ) ) { + else if ( JaxbBagElement.class.isInstance( attributeElement ) ) { attributeSources.add( new BagAttributeSourceImpl( - XMLBagElement.class.cast( attributeElement ), + JaxbBagElement.class.cast( attributeElement ), this ) ); } - else if ( XMLIdbagElement.class.isInstance( attributeElement ) ) { + else if ( JaxbIdbagElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLSetElement.class.isInstance( attributeElement ) ) { + else if ( JaxbSetElement.class.isInstance( attributeElement ) ) { attributeSources.add( new SetAttributeSourceImpl( - XMLSetElement.class.cast( attributeElement ), + JaxbSetElement.class.cast( attributeElement ), this ) ); } - else if ( XMLListElement.class.isInstance( attributeElement ) ) { + else if ( JaxbListElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLMapElement.class.isInstance( attributeElement ) ) { + else if ( JaxbMapElement.class.isInstance( attributeElement ) ) { // todo : implement } else { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractPluralAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractPluralAttributeSourceImpl.java index 61c88ad404..86a79cb7f5 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractPluralAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/AbstractPluralAttributeSourceImpl.java @@ -32,6 +32,7 @@ import org.hibernate.cfg.NotYetImplementedException; import org.hibernate.engine.FetchStyle; import org.hibernate.engine.FetchTiming; import org.hibernate.engine.spi.CascadeStyle; +import org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement; import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.binding.Caching; import org.hibernate.metamodel.binding.CustomSQL; @@ -43,8 +44,7 @@ import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.PluralAttributeElementSource; import org.hibernate.metamodel.source.binder.PluralAttributeKeySource; import org.hibernate.metamodel.source.binder.PluralAttributeSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLCacheElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbCacheElement; /** * @author Steve Ebersole @@ -162,7 +162,7 @@ public abstract class AbstractPluralAttributeSourceImpl implements PluralAttribu @Override public Caching getCaching() { - final XMLCacheElement cache = pluralAttributeElement.getCache(); + final JaxbCacheElement cache = pluralAttributeElement.getCache(); if ( cache == null ) { return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BagAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BagAttributeSourceImpl.java index cc67abc728..3c9d4c9e89 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BagAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BagAttributeSourceImpl.java @@ -27,13 +27,13 @@ import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.source.binder.AttributeSourceContainer; import org.hibernate.metamodel.source.binder.Orderable; import org.hibernate.metamodel.source.binder.PluralAttributeNature; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLBagElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbBagElement; /** * @author Steve Ebersole */ public class BagAttributeSourceImpl extends AbstractPluralAttributeSourceImpl implements Orderable { - public BagAttributeSourceImpl(XMLBagElement bagElement, AttributeSourceContainer container) { + public BagAttributeSourceImpl(JaxbBagElement bagElement, AttributeSourceContainer container) { super( bagElement, container ); } @@ -43,8 +43,8 @@ public class BagAttributeSourceImpl extends AbstractPluralAttributeSourceImpl im } @Override - public XMLBagElement getPluralAttributeElement() { - return (XMLBagElement) super.getPluralAttributeElement(); + public JaxbBagElement getPluralAttributeElement() { + return (JaxbBagElement) super.getPluralAttributeElement(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BasicPluralAttributeElementSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BasicPluralAttributeElementSourceImpl.java index 1372f7d789..71d155c628 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BasicPluralAttributeElementSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/BasicPluralAttributeElementSourceImpl.java @@ -31,7 +31,7 @@ import org.hibernate.metamodel.source.binder.BasicPluralAttributeElementSource; import org.hibernate.metamodel.source.binder.ExplicitHibernateTypeSource; import org.hibernate.metamodel.source.binder.PluralAttributeElementNature; import org.hibernate.metamodel.source.binder.RelationalValueSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLElementElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbElementElement; /** * @author Steve Ebersole @@ -41,7 +41,7 @@ public class BasicPluralAttributeElementSourceImpl implements BasicPluralAttribu private final ExplicitHibernateTypeSource typeSource; public BasicPluralAttributeElementSourceImpl( - final XMLElementElement elementElement, + final JaxbElementElement elementElement, LocalBindingContext bindingContext) { this.valueSources = Helper.buildValueSources( new Helper.ValueSourcesAdapter() { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ColumnSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ColumnSourceImpl.java index e16dc786da..b21708ec55 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ColumnSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ColumnSourceImpl.java @@ -26,20 +26,20 @@ package org.hibernate.metamodel.source.hbm; import org.hibernate.metamodel.relational.Datatype; import org.hibernate.metamodel.relational.Size; import org.hibernate.metamodel.source.binder.ColumnSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLColumnElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbColumnElement; /** * @author Steve Ebersole */ class ColumnSourceImpl implements ColumnSource { private final String tableName; - private final XMLColumnElement columnElement; + private final JaxbColumnElement columnElement; private boolean includedInInsert; private boolean includedInUpdate; ColumnSourceImpl( String tableName, - XMLColumnElement columnElement, + JaxbColumnElement columnElement, boolean isIncludedInInsert, boolean isIncludedInUpdate) { this.tableName = tableName; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ComponentAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ComponentAttributeSourceImpl.java index b0bd294ee7..3779f50c0d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ComponentAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ComponentAttributeSourceImpl.java @@ -38,27 +38,27 @@ import org.hibernate.metamodel.source.binder.ExplicitHibernateTypeSource; import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLAnyElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLComponentElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLManyToManyElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLManyToOneElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLOneToManyElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLOneToOneElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLPropertyElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLTuplizerElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbAnyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbComponentElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbManyToManyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbManyToOneElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbOneToManyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbOneToOneElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbPropertyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbTuplizerElement; /** * @author Steve Ebersole */ public class ComponentAttributeSourceImpl implements ComponentAttributeSource { - private final XMLComponentElement componentElement; + private final JaxbComponentElement componentElement; private final AttributeSourceContainer parentContainer; private final Value> componentClassReference; private final String path; public ComponentAttributeSourceImpl( - XMLComponentElement componentElement, + JaxbComponentElement componentElement, AttributeSourceContainer parentContainer, LocalBindingContext bindingContext) { this.componentElement = componentElement; @@ -101,7 +101,7 @@ public class ComponentAttributeSourceImpl implements ComponentAttributeSource { return null; } final EntityMode entityMode = StringHelper.isEmpty( componentElement.getClazz() ) ? EntityMode.MAP : EntityMode.POJO; - for ( XMLTuplizerElement tuplizerElement : componentElement.getTuplizer() ) { + for ( JaxbTuplizerElement tuplizerElement : componentElement.getTuplizer() ) { if ( entityMode == EntityMode.parse( tuplizerElement.getEntityMode() ) ) { return tuplizerElement.getClazz(); } @@ -113,41 +113,41 @@ public class ComponentAttributeSourceImpl implements ComponentAttributeSource { public Iterable attributeSources() { List attributeSources = new ArrayList(); for ( Object attributeElement : componentElement.getPropertyOrManyToOneOrOneToOne() ) { - if ( XMLPropertyElement.class.isInstance( attributeElement ) ) { + if ( JaxbPropertyElement.class.isInstance( attributeElement ) ) { attributeSources.add( new PropertyAttributeSourceImpl( - XMLPropertyElement.class.cast( attributeElement ), + JaxbPropertyElement.class.cast( attributeElement ), getLocalBindingContext() ) ); } - else if ( XMLComponentElement.class.isInstance( attributeElement ) ) { + else if ( JaxbComponentElement.class.isInstance( attributeElement ) ) { attributeSources.add( new ComponentAttributeSourceImpl( - (XMLComponentElement) attributeElement, + (JaxbComponentElement) attributeElement, this, getLocalBindingContext() ) ); } - else if ( XMLManyToOneElement.class.isInstance( attributeElement ) ) { + else if ( JaxbManyToOneElement.class.isInstance( attributeElement ) ) { attributeSources.add( new ManyToOneAttributeSourceImpl( - XMLManyToOneElement.class.cast( attributeElement ), + JaxbManyToOneElement.class.cast( attributeElement ), getLocalBindingContext() ) ); } - else if ( XMLOneToOneElement.class.isInstance( attributeElement ) ) { + else if ( JaxbOneToOneElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLAnyElement.class.isInstance( attributeElement ) ) { + else if ( JaxbAnyElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLOneToManyElement.class.isInstance( attributeElement ) ) { + else if ( JaxbOneToManyElement.class.isInstance( attributeElement ) ) { // todo : implement } - else if ( XMLManyToManyElement.class.isInstance( attributeElement ) ) { + else if ( JaxbManyToManyElement.class.isInstance( attributeElement ) ) { // todo : implement } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/CompositePluralAttributeElementSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/CompositePluralAttributeElementSourceImpl.java index da2c6f1b3e..87c612c86a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/CompositePluralAttributeElementSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/CompositePluralAttributeElementSourceImpl.java @@ -33,18 +33,18 @@ import org.hibernate.metamodel.source.LocalBindingContext; import org.hibernate.metamodel.source.binder.AttributeSource; import org.hibernate.metamodel.source.binder.CompositePluralAttributeElementSource; import org.hibernate.metamodel.source.binder.PluralAttributeElementNature; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLCompositeElementElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLTuplizerElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbCompositeElementElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbTuplizerElement; /** * @author Steve Ebersole */ public class CompositePluralAttributeElementSourceImpl implements CompositePluralAttributeElementSource { - private final XMLCompositeElementElement compositeElement; + private final JaxbCompositeElementElement compositeElement; private final LocalBindingContext bindingContext; public CompositePluralAttributeElementSourceImpl( - XMLCompositeElementElement compositeElement, + JaxbCompositeElementElement compositeElement, LocalBindingContext bindingContext) { this.compositeElement = compositeElement; this.bindingContext = bindingContext; @@ -78,7 +78,7 @@ public class CompositePluralAttributeElementSourceImpl implements CompositePlura return null; } final EntityMode entityMode = StringHelper.isEmpty( compositeElement.getClazz() ) ? EntityMode.MAP : EntityMode.POJO; - for ( XMLTuplizerElement tuplizerElement : compositeElement.getTuplizer() ) { + for ( JaxbTuplizerElement tuplizerElement : compositeElement.getTuplizer() ) { if ( entityMode == EntityMode.parse( tuplizerElement.getEntityMode() ) ) { return tuplizerElement.getClazz(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmBindingContext.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmBindingContext.java index 1639647078..83cd346efa 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmBindingContext.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmBindingContext.java @@ -26,11 +26,10 @@ package org.hibernate.metamodel.source.hbm; import java.util.List; import org.hibernate.metamodel.source.LocalBindingContext; -import org.hibernate.metamodel.source.Origin; import org.hibernate.metamodel.source.BindingContext; import org.hibernate.metamodel.source.MetaAttributeContext; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLFetchProfileElement; +import org.hibernate.internal.jaxb.mapping.hbm.EntityElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbFetchProfileElement; /** * Defines features specific to the {@code hbm.xml} variety of a {@link BindingContext} @@ -44,5 +43,5 @@ public interface HbmBindingContext extends LocalBindingContext { public String determineEntityName(EntityElement entityElement); - public void processFetchProfiles(List fetchProfiles, String containingEntityName); + public void processFetchProfiles(List fetchProfiles, String containingEntityName); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmMetadataSourceProcessorImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmMetadataSourceProcessorImpl.java index c4611120f2..b9bcf82def 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmMetadataSourceProcessorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HbmMetadataSourceProcessorImpl.java @@ -26,12 +26,12 @@ package org.hibernate.metamodel.source.hbm; import java.util.ArrayList; import java.util.List; +import org.hibernate.internal.jaxb.JaxbRoot; import org.hibernate.metamodel.MetadataSources; import org.hibernate.metamodel.source.MetadataImplementor; import org.hibernate.metamodel.source.MetadataSourceProcessor; import org.hibernate.metamodel.source.binder.Binder; -import org.hibernate.metamodel.source.internal.JaxbRoot; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; /** * The {@link org.hibernate.metamodel.source.MetadataSourceProcessor} implementation responsible for processing {@code hbm.xml} sources. @@ -54,7 +54,7 @@ public class HbmMetadataSourceProcessorImpl implements MetadataSourceProcessor { final HierarchyBuilder hierarchyBuilder = new HierarchyBuilder(); for ( JaxbRoot jaxbRoot : sources.getJaxbRootList() ) { - if ( ! XMLHibernateMapping.class.isInstance( jaxbRoot.getRoot() ) ) { + if ( ! JaxbHibernateMapping.class.isInstance( jaxbRoot.getRoot() ) ) { continue; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/Helper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/Helper.java index 1830f54cdb..c7313ad53e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/Helper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/Helper.java @@ -44,14 +44,14 @@ import org.hibernate.metamodel.source.MetaAttributeContext; import org.hibernate.metamodel.source.binder.ExplicitHibernateTypeSource; import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLColumnElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLJoinedSubclassElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLMetaElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLParamElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSubclassElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLUnionSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement; +import org.hibernate.internal.jaxb.mapping.hbm.EntityElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbColumnElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbJoinedSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbMetaElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbParamElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbUnionSubclassElement; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.service.classloading.spi.ClassLoadingException; @@ -74,13 +74,13 @@ public class Helper { }; public static InheritanceType interpretInheritanceType(EntityElement entityElement) { - if ( XMLSubclassElement.class.isInstance( entityElement ) ) { + if ( JaxbSubclassElement.class.isInstance( entityElement ) ) { return InheritanceType.SINGLE_TABLE; } - else if ( XMLJoinedSubclassElement.class.isInstance( entityElement ) ) { + else if ( JaxbJoinedSubclassElement.class.isInstance( entityElement ) ) { return InheritanceType.JOINED; } - else if ( XMLUnionSubclassElement.class.isInstance( entityElement ) ) { + else if ( JaxbUnionSubclassElement.class.isInstance( entityElement ) ) { return InheritanceType.TABLE_PER_CLASS; } else { @@ -144,12 +144,12 @@ public class Helper { } public static MetaAttributeContext extractMetaAttributeContext( - List metaElementList, + List metaElementList, boolean onlyInheritable, MetaAttributeContext parentContext) { final MetaAttributeContext subContext = new MetaAttributeContext( parentContext ); - for ( XMLMetaElement metaElement : metaElementList ) { + for ( JaxbMetaElement metaElement : metaElementList ) { if ( onlyInheritable & !metaElement.isInherit() ) { continue; } @@ -194,24 +194,24 @@ public class Helper { return cascadeStyles; } - public static Map extractParameters(List xmlParamElements) { + public static Map extractParameters(List xmlParamElements) { if ( xmlParamElements == null || xmlParamElements.isEmpty() ) { return null; } final HashMap params = new HashMap(); - for ( XMLParamElement paramElement : xmlParamElements ) { + for ( JaxbParamElement paramElement : xmlParamElements ) { params.put( paramElement.getName(), paramElement.getValue() ); } return params; } - public static Iterable buildMetaAttributeSources(List metaElements) { + public static Iterable buildMetaAttributeSources(List metaElements) { ArrayList result = new ArrayList(); if ( metaElements == null || metaElements.isEmpty() ) { // do nothing } else { - for ( final XMLMetaElement metaElement : metaElements ) { + for ( final JaxbMetaElement metaElement : metaElements ) { result.add( new MetaAttributeSource() { @Override @@ -317,11 +317,11 @@ public class Helper { else if ( valueSourcesAdapter.getColumnOrFormulaElements() != null && ! valueSourcesAdapter.getColumnOrFormulaElements().isEmpty() ) { for ( Object columnOrFormulaElement : valueSourcesAdapter.getColumnOrFormulaElements() ) { - if ( XMLColumnElement.class.isInstance( columnOrFormulaElement ) ) { + if ( JaxbColumnElement.class.isInstance( columnOrFormulaElement ) ) { result.add( new ColumnSourceImpl( valueSourcesAdapter.getContainingTableName(), - (XMLColumnElement) columnOrFormulaElement, + (JaxbColumnElement) columnOrFormulaElement, valueSourcesAdapter.isIncludedInInsertByDefault(), valueSourcesAdapter.isIncludedInUpdateByDefault() ) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HibernateMappingProcessor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HibernateMappingProcessor.java index 6ab1003626..1e86be5b19 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HibernateMappingProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HibernateMappingProcessor.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Set; import org.hibernate.engine.spi.FilterDefinition; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.Value; import org.hibernate.metamodel.binding.FetchProfile; @@ -38,12 +39,11 @@ import org.hibernate.metamodel.relational.AuxiliaryDatabaseObject; import org.hibernate.metamodel.relational.BasicAuxiliaryDatabaseObjectImpl; import org.hibernate.metamodel.source.MappingException; import org.hibernate.metamodel.source.MetadataImplementor; -import org.hibernate.metamodel.source.Origin; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLFetchProfileElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLParamElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLQueryElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSqlQueryElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbFetchProfileElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbParamElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbQueryElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSqlQueryElement; import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.service.classloading.spi.ClassLoadingException; import org.hibernate.type.Type; @@ -73,7 +73,7 @@ public class HibernateMappingProcessor { this.mappingDocument = mappingDocument; } - private XMLHibernateMapping mappingRoot() { + private JaxbHibernateMapping mappingRoot() { return mappingDocument.getMappingRoot(); } @@ -99,7 +99,7 @@ public class HibernateMappingProcessor { return; } - for ( XMLHibernateMapping.XMLDatabaseObject databaseObjectElement : mappingRoot().getDatabaseObject() ) { + for ( JaxbHibernateMapping.JaxbDatabaseObject databaseObjectElement : mappingRoot().getDatabaseObject() ) { final AuxiliaryDatabaseObject auxiliaryDatabaseObject; if ( databaseObjectElement.getDefinition() != null ) { final String className = databaseObjectElement.getDefinition().getClazz(); @@ -119,7 +119,7 @@ public class HibernateMappingProcessor { else { Set dialectScopes = new HashSet(); if ( databaseObjectElement.getDialectScope() != null ) { - for ( XMLHibernateMapping.XMLDatabaseObject.XMLDialectScope dialectScope : databaseObjectElement.getDialectScope() ) { + for ( JaxbHibernateMapping.JaxbDatabaseObject.JaxbDialectScope dialectScope : databaseObjectElement.getDialectScope() ) { dialectScopes.add( dialectScope.getName() ); } } @@ -139,9 +139,9 @@ public class HibernateMappingProcessor { return; } - for ( XMLHibernateMapping.XMLTypedef typedef : mappingRoot().getTypedef() ) { + for ( JaxbHibernateMapping.JaxbTypedef typedef : mappingRoot().getTypedef() ) { final Map parameters = new HashMap(); - for ( XMLParamElement paramElement : typedef.getParam() ) { + for ( JaxbParamElement paramElement : typedef.getParam() ) { parameters.put( paramElement.getName(), paramElement.getValue() ); } metadata.addTypeDefinition( @@ -164,7 +164,7 @@ public class HibernateMappingProcessor { return; } - for ( XMLHibernateMapping.XMLFilterDef filterDefinition : mappingRoot().getFilterDef() ) { + for ( JaxbHibernateMapping.JaxbFilterDef filterDefinition : mappingRoot().getFilterDef() ) { final String name = filterDefinition.getName(); final Map parameters = new HashMap(); String condition = null; @@ -176,8 +176,9 @@ public class HibernateMappingProcessor { } condition = (String) o; } - else if ( o instanceof XMLHibernateMapping.XMLFilterDef.XMLFilterParam ) { - final XMLHibernateMapping.XMLFilterDef.XMLFilterParam paramElement = (XMLHibernateMapping.XMLFilterDef.XMLFilterParam) o; + else if ( o instanceof JaxbHibernateMapping.JaxbFilterDef.JaxbFilterParam ) { + final JaxbHibernateMapping.JaxbFilterDef.JaxbFilterParam paramElement = + JaxbHibernateMapping.JaxbFilterDef.JaxbFilterParam.class.cast( o ); // todo : should really delay this resolution until later to allow typedef names parameters.put( paramElement.getName(), @@ -200,7 +201,7 @@ public class HibernateMappingProcessor { return; } - for ( XMLHibernateMapping.XMLIdentifierGenerator identifierGeneratorElement : mappingRoot().getIdentifierGenerator() ) { + for ( JaxbHibernateMapping.JaxbIdentifierGenerator identifierGeneratorElement : mappingRoot().getIdentifierGenerator() ) { metadata.registerIdentifierGenerator( identifierGeneratorElement.getName(), identifierGeneratorElement.getClazz() @@ -223,11 +224,11 @@ public class HibernateMappingProcessor { processFetchProfiles( mappingRoot().getFetchProfile(), null ); } - public void processFetchProfiles(List fetchProfiles, String containingEntityName) { - for ( XMLFetchProfileElement fetchProfile : fetchProfiles ) { + public void processFetchProfiles(List fetchProfiles, String containingEntityName) { + for ( JaxbFetchProfileElement fetchProfile : fetchProfiles ) { String profileName = fetchProfile.getName(); Set fetches = new HashSet(); - for ( XMLFetchProfileElement.XMLFetch fetch : fetchProfile.getFetch() ) { + for ( JaxbFetchProfileElement.JaxbFetch fetch : fetchProfile.getFetch() ) { String entityName = fetch.getEntity() == null ? containingEntityName : fetch.getEntity(); if ( entityName == null ) { throw new MappingException( @@ -247,7 +248,7 @@ public class HibernateMappingProcessor { return; } - for ( XMLHibernateMapping.XMLImport importValue : mappingRoot().getImport() ) { + for ( JaxbHibernateMapping.JaxbImport importValue : mappingRoot().getImport() ) { String className = mappingDocument.getMappingLocalBindingContext().qualifyClassName( importValue.getClazz() ); String rename = importValue.getRename(); rename = ( rename == null ) ? StringHelper.unqualify( className ) : rename; @@ -269,10 +270,10 @@ public class HibernateMappingProcessor { } for ( Object queryOrSqlQuery : mappingRoot().getQueryOrSqlQuery() ) { - if ( XMLQueryElement.class.isInstance( queryOrSqlQuery ) ) { + if ( JaxbQueryElement.class.isInstance( queryOrSqlQuery ) ) { // bindNamedQuery( element, null, mappings ); } - else if ( XMLSqlQueryElement.class.isInstance( queryOrSqlQuery ) ) { + else if ( JaxbSqlQueryElement.class.isInstance( queryOrSqlQuery ) ) { // bindNamedSQLQuery( element, null, mappings ); } else { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HierarchyBuilder.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HierarchyBuilder.java index 822f2b581b..a9e47b0649 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HierarchyBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/HierarchyBuilder.java @@ -30,14 +30,14 @@ import java.util.List; import java.util.Map; import org.hibernate.MappingException; +import org.hibernate.internal.jaxb.mapping.hbm.EntityElement; +import org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement; import org.hibernate.metamodel.source.binder.SubclassEntityContainer; import org.hibernate.metamodel.source.binder.SubclassEntitySource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLJoinedSubclassElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSubclassElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLUnionSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbJoinedSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbUnionSubclassElement; /** * @author Steve Ebersole @@ -65,10 +65,12 @@ public class HierarchyBuilder { private void processCurrentMappingDocument() { for ( Object entityElementO : currentMappingDocument.getMappingRoot().getClazzOrSubclassOrJoinedSubclass() ) { final EntityElement entityElement = (EntityElement) entityElementO; - if ( XMLHibernateMapping.XMLClass.class.isInstance( entityElement ) ) { + if ( JaxbHibernateMapping.JaxbClass.class.isInstance( entityElement ) ) { // we can immediately handle elements in terms of creating the hierarchy entry - final XMLHibernateMapping.XMLClass xmlClass = (XMLHibernateMapping.XMLClass) entityElement; - final RootEntitySourceImpl rootEntitySource = new RootEntitySourceImpl( currentMappingDocument, xmlClass ); + final JaxbHibernateMapping.JaxbClass jaxbClass = (JaxbHibernateMapping.JaxbClass) entityElement; + final RootEntitySourceImpl rootEntitySource = new RootEntitySourceImpl( currentMappingDocument, + jaxbClass + ); final EntityHierarchyImpl hierarchy = new EntityHierarchyImpl( rootEntitySource ); entityHierarchies.add( hierarchy ); @@ -125,23 +127,23 @@ public class HierarchyBuilder { } private void processSubElements(EntityElement entityElement, SubclassEntityContainer container) { - if ( XMLHibernateMapping.XMLClass.class.isInstance( entityElement ) ) { - final XMLHibernateMapping.XMLClass xmlClass = (XMLHibernateMapping.XMLClass) entityElement; - processElements( xmlClass.getJoinedSubclass(), container ); - processElements( xmlClass.getSubclass(), container ); - processElements( xmlClass.getUnionSubclass(), container ); + if ( JaxbHibernateMapping.JaxbClass.class.isInstance( entityElement ) ) { + final JaxbHibernateMapping.JaxbClass jaxbClass = (JaxbHibernateMapping.JaxbClass) entityElement; + processElements( jaxbClass.getJoinedSubclass(), container ); + processElements( jaxbClass.getSubclass(), container ); + processElements( jaxbClass.getUnionSubclass(), container ); } - else if ( XMLSubclassElement.class.isInstance( entityElement ) ) { - final XMLSubclassElement xmlSubclass = (XMLSubclassElement) entityElement; - processElements( xmlSubclass.getSubclass(), container ); + else if ( JaxbSubclassElement.class.isInstance( entityElement ) ) { + final JaxbSubclassElement jaxbSubclass = (JaxbSubclassElement) entityElement; + processElements( jaxbSubclass.getSubclass(), container ); } - else if ( XMLJoinedSubclassElement.class.isInstance( entityElement ) ) { - final XMLJoinedSubclassElement xmlJoinedSubclass = (XMLJoinedSubclassElement) entityElement; - processElements( xmlJoinedSubclass.getJoinedSubclass(), container ); + else if ( JaxbJoinedSubclassElement.class.isInstance( entityElement ) ) { + final JaxbJoinedSubclassElement jaxbJoinedSubclass = (JaxbJoinedSubclassElement) entityElement; + processElements( jaxbJoinedSubclass.getJoinedSubclass(), container ); } - else if ( XMLUnionSubclassElement.class.isInstance( entityElement ) ) { - final XMLUnionSubclassElement xmlUnionSubclass = (XMLUnionSubclassElement) entityElement; - processElements( xmlUnionSubclass.getUnionSubclass(), container ); + else if ( JaxbUnionSubclassElement.class.isInstance( entityElement ) ) { + final JaxbUnionSubclassElement jaxbUnionSubclass = (JaxbUnionSubclassElement) entityElement; + processElements( jaxbUnionSubclass.getUnionSubclass(), container ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToManyPluralAttributeElementSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToManyPluralAttributeElementSourceImpl.java index 430ee8a005..cde1928ad8 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToManyPluralAttributeElementSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToManyPluralAttributeElementSourceImpl.java @@ -31,19 +31,19 @@ import org.hibernate.metamodel.source.LocalBindingContext; import org.hibernate.metamodel.source.binder.ManyToManyPluralAttributeElementSource; import org.hibernate.metamodel.source.binder.PluralAttributeElementNature; import org.hibernate.metamodel.source.binder.RelationalValueSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLManyToManyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbManyToManyElement; /** * @author Steve Ebersole */ public class ManyToManyPluralAttributeElementSourceImpl implements ManyToManyPluralAttributeElementSource { - private final XMLManyToManyElement manyToManyElement; + private final JaxbManyToManyElement manyToManyElement; private final LocalBindingContext bindingContext; private final List valueSources; public ManyToManyPluralAttributeElementSourceImpl( - final XMLManyToManyElement manyToManyElement, + final JaxbManyToManyElement manyToManyElement, final LocalBindingContext bindingContext) { this.manyToManyElement = manyToManyElement; this.bindingContext = bindingContext; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToOneAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToOneAttributeSourceImpl.java index 6af7d1bd70..e7c88dd115 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToOneAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/ManyToOneAttributeSourceImpl.java @@ -37,7 +37,7 @@ import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; import org.hibernate.metamodel.source.binder.ToOneAttributeSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLManyToOneElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbManyToOneElement; /** * Implementation for {@code mappings} @@ -45,11 +45,11 @@ import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLManyToOneElement; * @author Steve Ebersole */ class ManyToOneAttributeSourceImpl implements ToOneAttributeSource { - private final XMLManyToOneElement manyToOneElement; + private final JaxbManyToOneElement manyToOneElement; private final LocalBindingContext bindingContext; private final List valueSources; - ManyToOneAttributeSourceImpl(final XMLManyToOneElement manyToOneElement, LocalBindingContext bindingContext) { + ManyToOneAttributeSourceImpl(final JaxbManyToOneElement manyToOneElement, LocalBindingContext bindingContext) { this.manyToOneElement = manyToOneElement; this.bindingContext = bindingContext; this.valueSources = Helper.buildValueSources( diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/MappingDocument.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/MappingDocument.java index f4f74494c2..a38f224d94 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/MappingDocument.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/MappingDocument.java @@ -26,16 +26,16 @@ package org.hibernate.metamodel.source.hbm; import java.util.List; import org.hibernate.cfg.NamingStrategy; +import org.hibernate.internal.jaxb.JaxbRoot; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.internal.util.Value; import org.hibernate.metamodel.domain.Type; import org.hibernate.metamodel.source.MappingDefaults; import org.hibernate.metamodel.source.MetaAttributeContext; import org.hibernate.metamodel.source.MetadataImplementor; -import org.hibernate.metamodel.source.Origin; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLFetchProfileElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; -import org.hibernate.metamodel.source.internal.JaxbRoot; +import org.hibernate.internal.jaxb.mapping.hbm.EntityElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbFetchProfileElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; import org.hibernate.metamodel.source.internal.OverriddenMappingDefaults; import org.hibernate.service.ServiceRegistry; @@ -45,16 +45,16 @@ import org.hibernate.service.ServiceRegistry; * @author Steve Ebersole */ public class MappingDocument { - private final JaxbRoot hbmJaxbRoot; + private final JaxbRoot hbmJaxbRoot; private final LocalBindingContextImpl mappingLocalBindingContext; - public MappingDocument(JaxbRoot hbmJaxbRoot, MetadataImplementor metadata) { + public MappingDocument(JaxbRoot hbmJaxbRoot, MetadataImplementor metadata) { this.hbmJaxbRoot = hbmJaxbRoot; this.mappingLocalBindingContext = new LocalBindingContextImpl( metadata ); } - public XMLHibernateMapping getMappingRoot() { + public JaxbHibernateMapping getMappingRoot() { return hbmJaxbRoot.getRoot(); } @@ -62,7 +62,7 @@ public class MappingDocument { return hbmJaxbRoot.getOrigin(); } - public JaxbRoot getJaxbRoot() { + public JaxbRoot getJaxbRoot() { return hbmJaxbRoot; } @@ -166,7 +166,7 @@ public class MappingDocument { } @Override - public void processFetchProfiles(List fetchProfiles, String containingEntityName) { + public void processFetchProfiles(List fetchProfiles, String containingEntityName) { // todo : this really needs to not be part of the context } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/OneToManyPluralAttributeElementSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/OneToManyPluralAttributeElementSourceImpl.java index 7920072af4..f326ad4f7a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/OneToManyPluralAttributeElementSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/OneToManyPluralAttributeElementSourceImpl.java @@ -27,17 +27,17 @@ import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.source.LocalBindingContext; import org.hibernate.metamodel.source.binder.OneToManyPluralAttributeElementSource; import org.hibernate.metamodel.source.binder.PluralAttributeElementNature; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLOneToManyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbOneToManyElement; /** * @author Steve Ebersole */ public class OneToManyPluralAttributeElementSourceImpl implements OneToManyPluralAttributeElementSource { - private final XMLOneToManyElement oneToManyElement; + private final JaxbOneToManyElement oneToManyElement; private final LocalBindingContext bindingContext; public OneToManyPluralAttributeElementSourceImpl( - XMLOneToManyElement oneToManyElement, + JaxbOneToManyElement oneToManyElement, LocalBindingContext bindingContext) { this.oneToManyElement = oneToManyElement; this.bindingContext = bindingContext; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PluralAttributeKeySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PluralAttributeKeySourceImpl.java index 4de22b245d..58510c9d1e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PluralAttributeKeySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PluralAttributeKeySourceImpl.java @@ -29,18 +29,18 @@ import org.hibernate.metamodel.relational.ForeignKey; import org.hibernate.metamodel.source.binder.AttributeSourceContainer; import org.hibernate.metamodel.source.binder.PluralAttributeKeySource; import org.hibernate.metamodel.source.binder.RelationalValueSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLKeyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbKeyElement; /** * @author Steve Ebersole */ public class PluralAttributeKeySourceImpl implements PluralAttributeKeySource { - private final XMLKeyElement keyElement; + private final JaxbKeyElement keyElement; private final List valueSources; public PluralAttributeKeySourceImpl( - final XMLKeyElement keyElement, + final JaxbKeyElement keyElement, final AttributeSourceContainer container) { this.keyElement = keyElement; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PropertyAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PropertyAttributeSourceImpl.java index 248e78505f..eaab67c198 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PropertyAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/PropertyAttributeSourceImpl.java @@ -33,7 +33,7 @@ import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; import org.hibernate.metamodel.source.binder.SingularAttributeSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLPropertyElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbPropertyElement; /** * Implementation for {@code } mappings @@ -41,11 +41,11 @@ import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLPropertyElement; * @author Steve Ebersole */ class PropertyAttributeSourceImpl implements SingularAttributeSource { - private final XMLPropertyElement propertyElement; + private final JaxbPropertyElement propertyElement; private final ExplicitHibernateTypeSource typeSource; private final List valueSources; - PropertyAttributeSourceImpl(final XMLPropertyElement propertyElement, LocalBindingContext bindingContext) { + PropertyAttributeSourceImpl(final JaxbPropertyElement propertyElement, LocalBindingContext bindingContext) { this.propertyElement = propertyElement; this.typeSource = new ExplicitHibernateTypeSource() { private final String name = propertyElement.getTypeAttribute() != null diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/RootEntitySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/RootEntitySourceImpl.java index b2ae01681c..35a5a22e6a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/RootEntitySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/RootEntitySourceImpl.java @@ -23,8 +23,6 @@ */ package org.hibernate.metamodel.source.hbm; -import java.util.Iterator; - import org.hibernate.EntityMode; import org.hibernate.cache.spi.access.AccessType; import org.hibernate.engine.OptimisticLockStyle; @@ -39,20 +37,20 @@ import org.hibernate.metamodel.source.binder.RootEntitySource; import org.hibernate.metamodel.source.binder.SimpleIdentifierSource; import org.hibernate.metamodel.source.binder.SingularAttributeSource; import org.hibernate.metamodel.source.binder.TableSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLCacheElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbCacheElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; /** * @author Steve Ebersole */ public class RootEntitySourceImpl extends AbstractEntitySourceImpl implements RootEntitySource { - protected RootEntitySourceImpl(MappingDocument sourceMappingDocument, XMLHibernateMapping.XMLClass entityElement) { + protected RootEntitySourceImpl(MappingDocument sourceMappingDocument, JaxbHibernateMapping.JaxbClass entityElement) { super( sourceMappingDocument, entityElement ); } @Override - protected XMLHibernateMapping.XMLClass entityElement() { - return (XMLHibernateMapping.XMLClass) super.entityElement(); + protected JaxbHibernateMapping.JaxbClass entityElement() { + return (JaxbHibernateMapping.JaxbClass) super.entityElement(); } @Override @@ -154,7 +152,7 @@ public class RootEntitySourceImpl extends AbstractEntitySourceImpl implements Ro @Override public Caching getCaching() { - final XMLCacheElement cache = entityElement().getCache(); + final JaxbCacheElement cache = entityElement().getCache(); if ( cache == null ) { return null; } @@ -197,7 +195,7 @@ public class RootEntitySourceImpl extends AbstractEntitySourceImpl implements Ro @Override public DiscriminatorSource getDiscriminatorSource() { - final XMLHibernateMapping.XMLClass.XMLDiscriminator discriminatorElement = entityElement().getDiscriminator(); + final JaxbHibernateMapping.JaxbClass.JaxbDiscriminator discriminatorElement = entityElement().getDiscriminator(); if ( discriminatorElement == null ) { return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SetAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SetAttributeSourceImpl.java index 18c6a1e932..d355355320 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SetAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SetAttributeSourceImpl.java @@ -28,19 +28,19 @@ import org.hibernate.metamodel.source.binder.AttributeSourceContainer; import org.hibernate.metamodel.source.binder.Orderable; import org.hibernate.metamodel.source.binder.PluralAttributeNature; import org.hibernate.metamodel.source.binder.Sortable; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSetElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSetElement; /** * @author Steve Ebersole */ public class SetAttributeSourceImpl extends AbstractPluralAttributeSourceImpl implements Orderable, Sortable { - public SetAttributeSourceImpl(XMLSetElement setElement, AttributeSourceContainer container) { + public SetAttributeSourceImpl(JaxbSetElement setElement, AttributeSourceContainer container) { super( setElement, container ); } @Override - public XMLSetElement getPluralAttributeElement() { - return (XMLSetElement) super.getPluralAttributeElement(); + public JaxbSetElement getPluralAttributeElement() { + return (JaxbSetElement) super.getPluralAttributeElement(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SingularIdentifierAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SingularIdentifierAttributeSourceImpl.java index 35354ec650..bf4837cc20 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SingularIdentifierAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SingularIdentifierAttributeSourceImpl.java @@ -33,7 +33,7 @@ import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; import org.hibernate.metamodel.source.binder.SingularAttributeSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; /** * Implementation for {@code } mappings @@ -41,12 +41,12 @@ import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; * @author Steve Ebersole */ class SingularIdentifierAttributeSourceImpl implements SingularAttributeSource { - private final XMLHibernateMapping.XMLClass.XMLId idElement; + private final JaxbHibernateMapping.JaxbClass.JaxbId idElement; private final ExplicitHibernateTypeSource typeSource; private final List valueSources; public SingularIdentifierAttributeSourceImpl( - final XMLHibernateMapping.XMLClass.XMLId idElement, + final JaxbHibernateMapping.JaxbClass.JaxbId idElement, LocalBindingContext bindingContext) { this.idElement = idElement; this.typeSource = new ExplicitHibernateTypeSource() { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SubclassEntitySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SubclassEntitySourceImpl.java index e0fa0bbe06..1b32dc1ba2 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SubclassEntitySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/SubclassEntitySourceImpl.java @@ -23,12 +23,12 @@ */ package org.hibernate.metamodel.source.hbm; +import org.hibernate.internal.jaxb.mapping.hbm.EntityElement; import org.hibernate.metamodel.source.binder.SubclassEntitySource; import org.hibernate.metamodel.source.binder.TableSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLJoinedSubclassElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLSubclassElement; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLUnionSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbJoinedSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbSubclassElement; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbUnionSubclassElement; /** * @author Steve Ebersole @@ -40,21 +40,21 @@ public class SubclassEntitySourceImpl extends AbstractEntitySourceImpl implement @Override public TableSource getPrimaryTable() { - if ( XMLJoinedSubclassElement.class.isInstance( entityElement() ) ) { + if ( JaxbJoinedSubclassElement.class.isInstance( entityElement() ) ) { return new TableSource() { @Override public String getExplicitSchemaName() { - return ( (XMLJoinedSubclassElement) entityElement() ).getSchema(); + return ( (JaxbJoinedSubclassElement) entityElement() ).getSchema(); } @Override public String getExplicitCatalogName() { - return ( (XMLJoinedSubclassElement) entityElement() ).getCatalog(); + return ( (JaxbJoinedSubclassElement) entityElement() ).getCatalog(); } @Override public String getExplicitTableName() { - return ( (XMLJoinedSubclassElement) entityElement() ).getTable(); + return ( (JaxbJoinedSubclassElement) entityElement() ).getTable(); } @Override @@ -64,21 +64,21 @@ public class SubclassEntitySourceImpl extends AbstractEntitySourceImpl implement } }; } - else if ( XMLUnionSubclassElement.class.isInstance( entityElement() ) ) { + else if ( JaxbUnionSubclassElement.class.isInstance( entityElement() ) ) { return new TableSource() { @Override public String getExplicitSchemaName() { - return ( (XMLUnionSubclassElement) entityElement() ).getSchema(); + return ( (JaxbUnionSubclassElement) entityElement() ).getSchema(); } @Override public String getExplicitCatalogName() { - return ( (XMLUnionSubclassElement) entityElement() ).getCatalog(); + return ( (JaxbUnionSubclassElement) entityElement() ).getCatalog(); } @Override public String getExplicitTableName() { - return ( (XMLUnionSubclassElement) entityElement() ).getTable(); + return ( (JaxbUnionSubclassElement) entityElement() ).getTable(); } @Override @@ -93,8 +93,8 @@ public class SubclassEntitySourceImpl extends AbstractEntitySourceImpl implement @Override public String getDiscriminatorMatchValue() { - return XMLSubclassElement.class.isInstance( entityElement() ) - ? ( (XMLSubclassElement) entityElement() ).getDiscriminatorValue() + return JaxbSubclassElement.class.isInstance( entityElement() ) + ? ( (JaxbSubclassElement) entityElement() ).getDiscriminatorValue() : null; } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java index 1717525194..2ceb47b87c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java @@ -35,7 +35,7 @@ import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; import org.hibernate.metamodel.source.binder.SingularAttributeSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; /** * Implementation for {@code } mappings @@ -43,12 +43,12 @@ import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; * @author Steve Ebersole */ class TimestampAttributeSourceImpl implements SingularAttributeSource { - private final XMLHibernateMapping.XMLClass.XMLTimestamp timestampElement; + private final JaxbHibernateMapping.JaxbClass.JaxbTimestamp timestampElement; private final LocalBindingContext bindingContext; private final List valueSources; TimestampAttributeSourceImpl( - final XMLHibernateMapping.XMLClass.XMLTimestamp timestampElement, + final JaxbHibernateMapping.JaxbClass.JaxbTimestamp timestampElement, LocalBindingContext bindingContext) { this.timestampElement = timestampElement; this.bindingContext = bindingContext; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/VersionAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/VersionAttributeSourceImpl.java index 5ca9b0ae61..5fdd2e3fe1 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/VersionAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/VersionAttributeSourceImpl.java @@ -35,7 +35,7 @@ import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; import org.hibernate.metamodel.source.binder.SingularAttributeSource; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; /** * Implementation for {@code } mappings @@ -43,12 +43,12 @@ import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; * @author Steve Ebersole */ class VersionAttributeSourceImpl implements SingularAttributeSource { - private final XMLHibernateMapping.XMLClass.XMLVersion versionElement; + private final JaxbHibernateMapping.JaxbClass.JaxbVersion versionElement; private final LocalBindingContext bindingContext; private final List valueSources; VersionAttributeSourceImpl( - final XMLHibernateMapping.XMLClass.XMLVersion versionElement, + final JaxbHibernateMapping.JaxbClass.JaxbVersion versionElement, LocalBindingContext bindingContext) { this.versionElement = versionElement; this.bindingContext = bindingContext; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbHelper.java index bbc1faa0b5..48360b410c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/internal/JaxbHelper.java @@ -50,12 +50,13 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; +import org.hibernate.internal.jaxb.JaxbRoot; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.metamodel.MetadataSources; import org.hibernate.metamodel.source.MappingException; -import org.hibernate.metamodel.source.Origin; import org.hibernate.metamodel.source.XsdException; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityMappings; -import org.hibernate.metamodel.source.hbm.jaxb.mapping.XMLHibernateMapping; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings; +import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping; import org.hibernate.service.classloading.spi.ClassLoaderService; /** @@ -138,11 +139,11 @@ public class JaxbHelper { final Attribute attribute = event.asStartElement().getAttributeByName( ORM_VERSION_ATTRIBUTE_QNAME ); final String explicitVersion = attribute == null ? null : attribute.getValue(); validationSchema = resolveSupportedOrmXsd( explicitVersion ); - jaxbTarget = XMLEntityMappings.class; + jaxbTarget = JaxbEntityMappings.class; } else { validationSchema = hbmSchema(); - jaxbTarget = XMLHibernateMapping.class; + jaxbTarget = JaxbHibernateMapping.class; } final Object target; @@ -182,11 +183,11 @@ public class JaxbHelper { if ( "entity-mappings".equals( rootElement.getNodeName() ) ) { final String explicitVersion = rootElement.getAttribute( "version" ); validationSchema = resolveSupportedOrmXsd( explicitVersion ); - jaxbTarget = XMLEntityMappings.class; + jaxbTarget = JaxbEntityMappings.class; } else { validationSchema = hbmSchema(); - jaxbTarget = XMLHibernateMapping.class; + jaxbTarget = JaxbHibernateMapping.class; } final Object target; diff --git a/hibernate-core/src/main/java/org/hibernate/service/ServiceRegistryBuilder.java b/hibernate-core/src/main/java/org/hibernate/service/ServiceRegistryBuilder.java index 07b7cbcc9b..fa07d817fb 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/ServiceRegistryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/service/ServiceRegistryBuilder.java @@ -37,12 +37,12 @@ import org.hibernate.cfg.Environment; import org.hibernate.integrator.spi.Integrator; import org.hibernate.integrator.spi.IntegratorService; import org.hibernate.integrator.spi.ServiceContributingIntegrator; +import org.hibernate.internal.jaxb.Origin; +import org.hibernate.internal.jaxb.SourceType; import org.hibernate.internal.util.Value; import org.hibernate.internal.util.config.ConfigurationException; import org.hibernate.internal.util.config.ConfigurationHelper; -import org.hibernate.metamodel.source.Origin; -import org.hibernate.metamodel.source.SourceType; -import org.hibernate.metamodel.source.hbm.jaxb.config.XMLHibernateConfiguration; +import org.hibernate.internal.jaxb.cfg.JaxbHibernateConfiguration; import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.service.internal.BasicServiceRegistryImpl; import org.hibernate.service.internal.BootstrapServiceRegistryImpl; @@ -156,11 +156,11 @@ public class ServiceRegistryBuilder { @SuppressWarnings( {"unchecked"}) public ServiceRegistryBuilder configure(String resourceName) { InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( resourceName ); - XMLHibernateConfiguration configurationElement = jaxbProcessorHolder.getValue().unmarshal( + JaxbHibernateConfiguration configurationElement = jaxbProcessorHolder.getValue().unmarshal( stream, new Origin( SourceType.RESOURCE, resourceName ) ); - for ( XMLHibernateConfiguration.XMLSessionFactory.XMLProperty xmlProperty : configurationElement.getSessionFactory().getProperty() ) { + for ( JaxbHibernateConfiguration.JaxbSessionFactory.JaxbProperty xmlProperty : configurationElement.getSessionFactory().getProperty() ) { settings.put( xmlProperty.getName(), xmlProperty.getValue() ); } diff --git a/hibernate-core/src/main/java/org/hibernate/service/internal/JaxbProcessor.java b/hibernate-core/src/main/java/org/hibernate/service/internal/JaxbProcessor.java index 63e2a50b70..4df7305b0f 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/internal/JaxbProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/service/internal/JaxbProcessor.java @@ -43,11 +43,11 @@ import java.net.URL; import org.jboss.logging.Logger; import org.xml.sax.SAXException; +import org.hibernate.internal.jaxb.Origin; import org.hibernate.internal.util.config.ConfigurationException; import org.hibernate.metamodel.source.MappingException; -import org.hibernate.metamodel.source.Origin; import org.hibernate.metamodel.source.XsdException; -import org.hibernate.metamodel.source.hbm.jaxb.config.XMLHibernateConfiguration; +import org.hibernate.internal.jaxb.cfg.JaxbHibernateConfiguration; import org.hibernate.service.classloading.spi.ClassLoaderService; /** @@ -62,7 +62,7 @@ public class JaxbProcessor { this.classLoaderService = classLoaderService; } - public XMLHibernateConfiguration unmarshal(InputStream stream, Origin origin) { + public JaxbHibernateConfiguration unmarshal(InputStream stream, Origin origin) { try { XMLStreamReader staxReader = staxFactory().createXMLStreamReader( stream ); try { @@ -97,16 +97,16 @@ public class JaxbProcessor { } @SuppressWarnings( { "unchecked" }) - private XMLHibernateConfiguration unmarshal(XMLStreamReader staxReader, final Origin origin) { + private JaxbHibernateConfiguration unmarshal(XMLStreamReader staxReader, final Origin origin) { final Object target; final ContextProvidingValidationEventHandler handler = new ContextProvidingValidationEventHandler(); try { - JAXBContext jaxbContext = JAXBContext.newInstance( XMLHibernateConfiguration.class ); + JAXBContext jaxbContext = JAXBContext.newInstance( JaxbHibernateConfiguration.class ); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setSchema( schema() ); unmarshaller.setEventHandler( handler ); target = unmarshaller.unmarshal( staxReader ); - return (XMLHibernateConfiguration) target; + return (JaxbHibernateConfiguration) target; } catch ( JAXBException e ) { StringBuilder builder = new StringBuilder(); diff --git a/hibernate-core/src/main/xjb/hbm-configuration-bindings.xjb b/hibernate-core/src/main/xjb/hbm-configuration-bindings.xjb index 2792774a62..59b19b75b1 100644 --- a/hibernate-core/src/main/xjb/hbm-configuration-bindings.xjb +++ b/hibernate-core/src/main/xjb/hbm-configuration-bindings.xjb @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/hibernate-core/src/main/xjb/hbm-mapping-bindings.xjb b/hibernate-core/src/main/xjb/hbm-mapping-bindings.xjb index 274320a2ee..51811d9748 100644 --- a/hibernate-core/src/main/xjb/hbm-mapping-bindings.xjb +++ b/hibernate-core/src/main/xjb/hbm-mapping-bindings.xjb @@ -10,70 +10,70 @@ - - - - + + + + - org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.JoinElementSource + org.hibernate.internal.jaxb.mapping.hbm.EntityElement + org.hibernate.internal.jaxb.mapping.hbm.JoinElementSource - org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.JoinElementSource + org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement + org.hibernate.internal.jaxb.mapping.hbm.JoinElementSource - org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement + org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement + org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement + org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement + org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement + org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement + org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.SingularAttributeSource + org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource - org.hibernate.metamodel.source.hbm.jaxb.mapping.SingularAttributeSource + org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource - org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement + org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.IdBagPluralAttributeElementAdapter + org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement + org.hibernate.internal.jaxb.mapping.hbm.IdBagPluralAttributeElementAdapter - org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement + org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement + org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement - org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement + org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement diff --git a/hibernate-core/src/main/xjb/orm-bindings.xjb b/hibernate-core/src/main/xjb/orm-bindings.xjb index 097000b5de..0a30ac387a 100644 --- a/hibernate-core/src/main/xjb/orm-bindings.xjb +++ b/hibernate-core/src/main/xjb/orm-bindings.xjb @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMockerTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMockerTest.java index fb7f33a4c2..62a3c98b2e 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMockerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/AbstractMockerTest.java @@ -38,7 +38,7 @@ import org.jboss.jandex.Indexer; import org.hibernate.AnnotationException; import org.hibernate.HibernateException; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityMappings; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntityMappings; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.testing.ServiceRegistryBuilder; @@ -67,19 +67,19 @@ public abstract class AbstractMockerTest { protected EntityMappingsMocker getEntityMappingsMocker(String... mappingFiles) { ClassLoaderService classLoaderService = getServiceRegistry().getService( ClassLoaderService.class ); - List xmlEntityMappingsList = new ArrayList(); + List xmlEntityMappingsList = new ArrayList(); for ( String fileName : mappingFiles ) { - XMLEntityMappings entityMappings; + JaxbEntityMappings entityMappings; try { entityMappings = XmlHelper.unmarshallXml( - packagePrefix + fileName, ORM2_MAPPING_XSD, XMLEntityMappings.class, classLoaderService + packagePrefix + fileName, ORM2_MAPPING_XSD, JaxbEntityMappings.class, classLoaderService ).getRoot(); } catch ( JAXBException orm2Exception ) { // if we cannot parse against orm_2_0.xsd we try orm_1_0.xsd for backwards compatibility try { entityMappings = XmlHelper.unmarshallXml( - packagePrefix + fileName, ORM1_MAPPING_XSD, XMLEntityMappings.class, classLoaderService + packagePrefix + fileName, ORM1_MAPPING_XSD, JaxbEntityMappings.class, classLoaderService ).getRoot(); } catch ( JAXBException orm1Exception ) { diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMockerTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMockerTest.java index e4fe64ef32..f53b4f2314 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMockerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/BasicMockerTest.java @@ -29,10 +29,10 @@ import org.jboss.jandex.DotName; import org.jboss.jandex.Index; import org.junit.Test; -import org.hibernate.metamodel.source.annotation.jaxb.XMLAttributes; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; -import org.hibernate.metamodel.source.annotation.jaxb.XMLGeneratedValue; -import org.hibernate.metamodel.source.annotation.jaxb.XMLId; +import org.hibernate.internal.jaxb.mapping.orm.JaxbAttributes; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbGeneratedValue; +import org.hibernate.internal.jaxb.mapping.orm.JaxbId; import org.hibernate.metamodel.source.annotations.JPADotNames; import static org.junit.Assert.assertEquals; @@ -43,7 +43,7 @@ import static org.junit.Assert.assertEquals; public class BasicMockerTest extends AbstractMockerTest { @Test public void testEntity() { - XMLEntity entity = createEntity(); + JaxbEntity entity = createEntity(); IndexBuilder indexBuilder = getIndexBuilder(); EntityMocker entityMocker = new EntityMocker( indexBuilder, entity, new EntityMappingsMocker.Default() ); entityMocker.preProcess(); @@ -59,7 +59,7 @@ public class BasicMockerTest extends AbstractMockerTest { @Test public void testEntityWithEntityMappingsConfiguration() { - XMLEntity entity = new XMLEntity(); + JaxbEntity entity = new JaxbEntity(); entity.setName( "Item" ); entity.setClazz( "Item" ); IndexBuilder indexBuilder = getIndexBuilder(); @@ -91,14 +91,14 @@ public class BasicMockerTest extends AbstractMockerTest { } - private XMLEntity createEntity() { - XMLEntity entity = new XMLEntity(); + private JaxbEntity createEntity() { + JaxbEntity entity = new JaxbEntity(); entity.setName( "Item" ); entity.setClazz( Item.class.getName() ); - XMLAttributes attributes = new XMLAttributes(); - XMLId id = new XMLId(); + JaxbAttributes attributes = new JaxbAttributes(); + JaxbId id = new JaxbId(); id.setName( "id" ); - id.setGeneratedValue( new XMLGeneratedValue() ); + id.setGeneratedValue( new JaxbGeneratedValue() ); attributes.getId().add( id ); entity.setAttributes( attributes ); return entity; diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelperTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelperTest.java index af95f98934..2a5e913c73 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelperTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/DefaultConfigurationHelperTest.java @@ -18,7 +18,7 @@ import org.jboss.jandex.DotName; import org.jboss.jandex.Index; import org.junit.Test; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; import org.hibernate.metamodel.source.annotations.JPADotNames; import static org.junit.Assert.assertArrayEquals; @@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue; public class DefaultConfigurationHelperTest extends AbstractMockerTest { @Test public void applyNullDefaultToEntity() { - XMLEntity entity = new XMLEntity(); + JaxbEntity entity = new JaxbEntity(); entity.setClazz( "Entity" ); DefaultConfigurationHelper.INSTANCE.applyDefaults( entity, null ); assertNull( entity.getTable() ); @@ -46,7 +46,7 @@ public class DefaultConfigurationHelperTest extends AbstractMockerTest { defaults.setPackageName( "org.test" ); defaults.setSchema( "schema" ); defaults.setMetadataComplete( true ); - XMLEntity entity = new XMLEntity(); + JaxbEntity entity = new JaxbEntity(); entity.setClazz( "Entity" ); DefaultConfigurationHelper.INSTANCE.applyDefaults( entity, defaults ); assertNotNull( entity.getTable() ); diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/OverrideTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/OverrideTest.java index e011f161f2..2f796486de 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/OverrideTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/OverrideTest.java @@ -32,7 +32,7 @@ import org.jboss.jandex.DotName; import org.jboss.jandex.Index; import org.junit.Test; -import org.hibernate.metamodel.source.annotation.jaxb.XMLEntity; +import org.hibernate.internal.jaxb.mapping.orm.JaxbEntity; import org.hibernate.metamodel.source.annotations.JPADotNames; import static org.junit.Assert.assertArrayEquals; @@ -56,7 +56,7 @@ public class OverrideTest extends AbstractMockerTest { @Test public void testPersistenceUnitMetadataMetadataComplete() { - XMLEntity author = new XMLEntity(); + JaxbEntity author = new JaxbEntity(); author.setClazz( Author.class.getName() ); IndexBuilder indexBuilder = getIndexBuilder(); EntityMappingsMocker.Default defaults = new EntityMappingsMocker.Default(); @@ -98,7 +98,7 @@ public class OverrideTest extends AbstractMockerTest { @Test public void testPersistenceUnitDefaultsCascadePersistInAnnotation() { - XMLEntity author = new XMLEntity(); + JaxbEntity author = new JaxbEntity(); author.setClazz( Author.class.getName() ); IndexBuilder indexBuilder = getIndexBuilder(); EntityMappingsMocker.Default defaults = new EntityMappingsMocker.Default(); diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/XmlHelper.java b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/XmlHelper.java index a6f0115d8a..aa618d374b 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/XmlHelper.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/source/annotations/xml/mocker/XmlHelper.java @@ -37,8 +37,8 @@ import org.hibernate.internal.CoreMessageLogger; import org.jboss.logging.Logger; import org.xml.sax.SAXException; -import org.hibernate.metamodel.source.Origin; -import org.hibernate.metamodel.source.internal.JaxbRoot; +import org.hibernate.internal.jaxb.Origin; +import org.hibernate.internal.jaxb.JaxbRoot; import org.hibernate.service.classloading.spi.ClassLoaderService; /**