HHH-6653 - Clean up JAXB generated classes
This commit is contained in:
parent
9f214d8018
commit
d652de654c
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
|
@ -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;
|
||||
|
|
@ -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
|
||||
*/
|
|
@ -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();
|
||||
}
|
|
@ -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<XMLTuplizerElement> getTuplizer();
|
||||
public List<JaxbTuplizerElement> 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<XMLSynchronizeElement> getSynchronize();
|
||||
public List<JaxbSynchronizeElement> getSynchronize();
|
||||
|
||||
public List<XMLFetchProfileElement> getFetchProfile();
|
||||
public List<JaxbFetchProfileElement> getFetchProfile();
|
||||
|
||||
public List<XMLResultsetElement> getResultset();
|
||||
public List<JaxbResultsetElement> getResultset();
|
||||
|
||||
public List<Object> getQueryOrSqlQuery();
|
||||
|
|
@ -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 <idbag/>} 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;
|
||||
}
|
|
@ -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<XMLJoinElement> getJoin();
|
||||
public List<JaxbJoinElement> getJoin();
|
||||
}
|
|
@ -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<XMLMetaElement> getMeta();
|
||||
public List<JaxbMetaElement> getMeta();
|
||||
}
|
|
@ -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<XMLSynchronizeElement> getSynchronize();
|
||||
public List<JaxbSynchronizeElement> getSynchronize();
|
||||
|
||||
public XMLCacheElement getCache();
|
||||
public List<XMLFilterElement> getFilter();
|
||||
public JaxbCacheElement getCache();
|
||||
public List<JaxbFilterElement> 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();
|
|
@ -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();
|
||||
}
|
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
*/
|
||||
package org.hibernate.metamodel.source;
|
||||
|
||||
import org.hibernate.internal.jaxb.Origin;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
package org.hibernate.metamodel.source;
|
||||
|
||||
import org.hibernate.internal.jaxb.Origin;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
|
|
|
@ -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<JaxbRoot<XMLEntityMappings>> mappings = new ArrayList<JaxbRoot<XMLEntityMappings>>();
|
||||
List<JaxbRoot<JaxbEntityMappings>> mappings = new ArrayList<JaxbRoot<JaxbEntityMappings>>();
|
||||
for ( JaxbRoot<?> root : sources.getJaxbRootList() ) {
|
||||
if ( root.getRoot() instanceof XMLEntityMappings ) {
|
||||
mappings.add( (JaxbRoot<XMLEntityMappings>) root );
|
||||
if ( root.getRoot() instanceof JaxbEntityMappings ) {
|
||||
mappings.add( (JaxbRoot<JaxbEntityMappings>) root );
|
||||
}
|
||||
}
|
||||
if ( !mappings.isEmpty() ) {
|
||||
|
@ -143,9 +143,9 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
|||
FilterDefBinder.bind( bindingContext );
|
||||
}
|
||||
|
||||
private Index parseAndUpdateIndex(List<JaxbRoot<XMLEntityMappings>> mappings, Index annotationIndex) {
|
||||
List<XMLEntityMappings> list = new ArrayList<XMLEntityMappings>( mappings.size() );
|
||||
for ( JaxbRoot<XMLEntityMappings> jaxbRoot : mappings ) {
|
||||
private Index parseAndUpdateIndex(List<JaxbRoot<JaxbEntityMappings>> mappings, Index annotationIndex) {
|
||||
List<JaxbEntityMappings> list = new ArrayList<JaxbEntityMappings>( mappings.size() );
|
||||
for ( JaxbRoot<JaxbEntityMappings> jaxbRoot : mappings ) {
|
||||
list.add( jaxbRoot.getRoot() );
|
||||
}
|
||||
return new EntityMappingsMocker( list, annotationIndex, metadata.getServiceRegistry() ).mockNewIndex();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<XMLId> getId();
|
||||
abstract List<JaxbId> getId();
|
||||
|
||||
abstract List<XMLTransient> getTransient();
|
||||
abstract List<JaxbTransient> getTransient();
|
||||
|
||||
abstract List<XMLVersion> getVersion();
|
||||
abstract List<JaxbVersion> getVersion();
|
||||
|
||||
abstract List<XMLBasic> getBasic();
|
||||
abstract List<JaxbBasic> getBasic();
|
||||
|
||||
abstract List<XMLElementCollection> getElementCollection();
|
||||
abstract List<JaxbElementCollection> getElementCollection();
|
||||
|
||||
abstract List<XMLEmbedded> getEmbedded();
|
||||
abstract List<JaxbEmbedded> getEmbedded();
|
||||
|
||||
abstract List<XMLManyToMany> getManyToMany();
|
||||
abstract List<JaxbManyToMany> getManyToMany();
|
||||
|
||||
abstract List<XMLManyToOne> getManyToOne();
|
||||
abstract List<JaxbManyToOne> getManyToOne();
|
||||
|
||||
abstract List<XMLOneToMany> getOneToMany();
|
||||
abstract List<JaxbOneToMany> getOneToMany();
|
||||
|
||||
abstract List<XMLOneToOne> getOneToOne();
|
||||
abstract List<JaxbOneToOne> getOneToOne();
|
||||
|
||||
abstract XMLEmbeddedId getEmbeddedId();
|
||||
abstract JaxbEmbeddedId getEmbeddedId();
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<XMLUniqueConstraint> constraints, List<AnnotationValue> annotationValueList) {
|
||||
protected void nestedUniqueConstraintList(String name, List<JaxbUniqueConstraint> constraints, List<AnnotationValue> 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;
|
||||
}
|
||||
|
|
|
@ -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<DotName, List<AnnotationInstance>> indexedAnnotations = indexBuilder.getIndexedAnnotations( className );
|
||||
Map<DotName, List<AnnotationInstance>> 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<DotName, List<AnnotationInstance>> annotations) {
|
||||
private static JaxbAccessType getAccessFromIdPosition(Map<DotName, List<AnnotationInstance>> 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<AnnotationInstance> idAnnotations) {
|
||||
XMLAccessType accessType = null;
|
||||
private static JaxbAccessType processIdAnnotations(List<AnnotationInstance> 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<DotName, List<AnnotationInstance>> indexedAnnotations = indexBuilder.getIndexedAnnotations( className );
|
||||
Map<DotName, List<AnnotationInstance>> 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<DotName, List<AnnotationInstance>> annotations) {
|
||||
private static JaxbAccessType getAccess(Map<DotName, List<AnnotationInstance>> 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<DotName, List<AnnotationInstance>> indexedAnnotations = indexBuilder.getIndexedAnnotations( className );
|
||||
if ( indexedAnnotations != null && indexedAnnotations.containsKey( ACCESS ) ) {
|
||||
List<AnnotationInstance> 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;
|
||||
}
|
||||
|
|
|
@ -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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<XMLJoinColumn> columns, List<AnnotationValue> annotationValueList) {
|
||||
private AnnotationValue[] nestedJoinColumnList(String name, List<JaxbJoinColumn> columns, List<AnnotationValue> 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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<XMLPrimaryKeyJoinColumn> primaryKeyJoinColumnList, AnnotationTarget target) {
|
||||
protected AnnotationInstance parserPrimaryKeyJoinColumnList(List<JaxbPrimaryKeyJoinColumn> 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<XMLPrimaryKeyJoinColumn> constraints, List<AnnotationValue> annotationValueList) {
|
||||
protected AnnotationValue[] nestedPrimaryKeyJoinColumnList(String name, List<JaxbPrimaryKeyJoinColumn> constraints, List<AnnotationValue> 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<XMLAttributeOverride> attributeOverrides, AnnotationTarget target) {
|
||||
protected AnnotationInstance parserAttributeOverrides(List<JaxbAttributeOverride> 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<String> names = new HashSet<String>();
|
||||
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<XMLAssociationOverride> associationOverrides, AnnotationTarget target) {
|
||||
protected AnnotationInstance parserAssociationOverrides(List<JaxbAssociationOverride> associationOverrides, AnnotationTarget target) {
|
||||
if ( target == null ) {
|
||||
throw new AssertionFailure( "target can not be null" );
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ abstract class AnnotationMocker extends AbstractMocker {
|
|||
}
|
||||
|
||||
Set<String> names = new HashSet<String>();
|
||||
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<XMLJoinColumn> joinColumnList, AnnotationTarget target) {
|
||||
protected AnnotationInstance parserJoinColumnList(List<JaxbJoinColumn> 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<String> names;
|
||||
private List<XMLAttributeOverride> attributeOverrides;
|
||||
private List<JaxbAttributeOverride> attributeOverrides;
|
||||
|
||||
AttributeOverrideOperation(Set<String> names, List<XMLAttributeOverride> attributeOverrides) {
|
||||
AttributeOverrideOperation(Set<String> names, List<JaxbAttributeOverride> 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<String> names;
|
||||
private List<XMLAssociationOverride> associationOverrides;
|
||||
private List<JaxbAssociationOverride> associationOverrides;
|
||||
|
||||
AssociationOverrideOperation(Set<String> names, List<XMLAssociationOverride> associationOverrides) {
|
||||
AssociationOverrideOperation(Set<String> names, List<JaxbAssociationOverride> 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() {
|
||||
|
|
|
@ -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<XMLBasic> getBasic() {
|
||||
List<JaxbBasic> getBasic() {
|
||||
return attributes.getBasic();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLId> getId() {
|
||||
List<JaxbId> getId() {
|
||||
return attributes.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLTransient> getTransient() {
|
||||
List<JaxbTransient> getTransient() {
|
||||
return attributes.getTransient();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLVersion> getVersion() {
|
||||
List<JaxbVersion> getVersion() {
|
||||
return attributes.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLElementCollection> getElementCollection() {
|
||||
List<JaxbElementCollection> getElementCollection() {
|
||||
return attributes.getElementCollection();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLEmbedded> getEmbedded() {
|
||||
List<JaxbEmbedded> getEmbedded() {
|
||||
return attributes.getEmbedded();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLManyToMany> getManyToMany() {
|
||||
List<JaxbManyToMany> getManyToMany() {
|
||||
return attributes.getManyToMany();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLManyToOne> getManyToOne() {
|
||||
List<JaxbManyToOne> getManyToOne() {
|
||||
return attributes.getManyToOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLOneToMany> getOneToMany() {
|
||||
List<JaxbOneToMany> getOneToMany() {
|
||||
return attributes.getOneToMany();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLOneToOne> getOneToOne() {
|
||||
List<JaxbOneToOne> getOneToOne() {
|
||||
return attributes.getOneToOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
XMLEmbeddedId getEmbeddedId() {
|
||||
JaxbEmbeddedId getEmbeddedId() {
|
||||
return attributes.getEmbeddedId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<XMLBasic> getBasic() {
|
||||
List<JaxbBasic> getBasic() {
|
||||
return attributes.getBasic();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLId> getId() {
|
||||
List<JaxbId> getId() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLTransient> getTransient() {
|
||||
List<JaxbTransient> getTransient() {
|
||||
return attributes.getTransient();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLVersion> getVersion() {
|
||||
List<JaxbVersion> getVersion() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLElementCollection> getElementCollection() {
|
||||
List<JaxbElementCollection> getElementCollection() {
|
||||
return attributes.getElementCollection();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLEmbedded> getEmbedded() {
|
||||
List<JaxbEmbedded> getEmbedded() {
|
||||
return attributes.getEmbedded();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLManyToMany> getManyToMany() {
|
||||
List<JaxbManyToMany> getManyToMany() {
|
||||
return attributes.getManyToMany();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLManyToOne> getManyToOne() {
|
||||
List<JaxbManyToOne> getManyToOne() {
|
||||
return attributes.getManyToOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLOneToMany> getOneToMany() {
|
||||
List<JaxbOneToMany> getOneToMany() {
|
||||
return attributes.getOneToMany();
|
||||
}
|
||||
|
||||
@Override
|
||||
List<XMLOneToOne> getOneToOne() {
|
||||
List<JaxbOneToOne> getOneToOne() {
|
||||
return attributes.getOneToOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
XMLEmbeddedId getEmbeddedId() {
|
||||
JaxbEmbeddedId getEmbeddedId() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 <embeddable> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<XMLEntityMappings> entityMappingsList;
|
||||
private final List<JaxbEntityMappings> 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<XMLEntityMappings> entityMappingsList, Index index, ServiceRegistry serviceRegistry) {
|
||||
public EntityMappingsMocker(List<JaxbEntityMappings> 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<XMLEntityMappings> entityMappingsList) {
|
||||
for ( XMLEntityMappings entityMappings : entityMappingsList ) {
|
||||
private void processPersistenceUnitMetadata(List<JaxbEntityMappings> 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<XMLEntityMappings> entityMappingsList) {
|
||||
private void processEntityMappings(List<JaxbEntityMappings> entityMappingsList) {
|
||||
List<AbstractEntityObjectMocker> mockerList = new ArrayList<AbstractEntityObjectMocker>();
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 <entity> 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<XMLSecondaryTable> primaryKeyJoinColumnList, AnnotationTarget target) {
|
||||
protected AnnotationInstance parserSecondaryTableList(List<JaxbSecondaryTable> 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<XMLSecondaryTable> secondaryTableList, List<AnnotationValue> annotationValueList) {
|
||||
protected AnnotationValue[] nestedSecondaryTableList(String name, List<JaxbSecondaryTable> secondaryTableList, List<AnnotationValue> annotationValueList) {
|
||||
if ( MockHelper.isNotEmpty( secondaryTableList ) ) {
|
||||
AnnotationValue[] values = new AnnotationValue[secondaryTableList.size()];
|
||||
for ( int i = 0; i < secondaryTableList.size(); i++ ) {
|
||||
|
|
|
@ -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<XMLNamedQuery> namedQueries = globalAnnotations.getNamedQueryMap().values();
|
||||
Collection<JaxbNamedQuery> namedQueries = globalAnnotations.getNamedQueryMap().values();
|
||||
if ( namedQueries.size() > 1 ) {
|
||||
parserNamedQueries( namedQueries );
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class GlobalAnnotationMocker extends AbstractMocker {
|
|||
}
|
||||
}
|
||||
if ( !globalAnnotations.getNamedNativeQueryMap().isEmpty() ) {
|
||||
Collection<XMLNamedNativeQuery> namedQueries = globalAnnotations.getNamedNativeQueryMap().values();
|
||||
Collection<JaxbNamedNativeQuery> 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<XMLSqlResultSetMapping> namedQueries) {
|
||||
private AnnotationInstance parserSqlResultSetMappings(Collection<JaxbSqlResultSetMapping> namedQueries) {
|
||||
AnnotationValue[] values = new AnnotationValue[namedQueries.size()];
|
||||
int i = 0;
|
||||
for ( Iterator<XMLSqlResultSetMapping> iterator = namedQueries.iterator(); iterator.hasNext(); ) {
|
||||
for ( Iterator<JaxbSqlResultSetMapping> 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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
MockHelper.stringValue(
|
||||
|
@ -138,7 +138,7 @@ class GlobalAnnotationMocker extends AbstractMocker {
|
|||
);
|
||||
}
|
||||
|
||||
private void nestedEntityResultList(String name, List<XMLEntityResult> entityResults, List<AnnotationValue> annotationValueList) {
|
||||
private void nestedEntityResultList(String name, List<JaxbEntityResult> entityResults, List<AnnotationValue> 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<XMLColumnResult> columnResults, List<AnnotationValue> annotationValueList) {
|
||||
private void nestedColumnResultList(String name, List<JaxbColumnResult> columnResults, List<AnnotationValue> 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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<XMLFieldResult> fieldResultList, List<AnnotationValue> annotationValueList) {
|
||||
private void nestedFieldResultList(String name, List<JaxbFieldResult> fieldResultList, List<AnnotationValue> 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<XMLNamedNativeQuery> namedQueries) {
|
||||
private AnnotationInstance parserNamedNativeQueries(Collection<JaxbNamedNativeQuery> namedQueries) {
|
||||
AnnotationValue[] values = new AnnotationValue[namedQueries.size()];
|
||||
int i = 0;
|
||||
for ( Iterator<XMLNamedNativeQuery> iterator = namedQueries.iterator(); iterator.hasNext(); ) {
|
||||
for ( Iterator<JaxbNamedNativeQuery> 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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
MockHelper.stringValue( "name", namedNativeQuery.getName(), annotationValueList );
|
||||
MockHelper.stringValue( "query", namedNativeQuery.getQuery(), annotationValueList );
|
||||
|
@ -233,10 +233,10 @@ class GlobalAnnotationMocker extends AbstractMocker {
|
|||
}
|
||||
|
||||
|
||||
private AnnotationInstance parserNamedQueries(Collection<XMLNamedQuery> namedQueries) {
|
||||
private AnnotationInstance parserNamedQueries(Collection<JaxbNamedQuery> namedQueries) {
|
||||
AnnotationValue[] values = new AnnotationValue[namedQueries.size()];
|
||||
int i = 0;
|
||||
for ( Iterator<XMLNamedQuery> iterator = namedQueries.iterator(); iterator.hasNext(); ) {
|
||||
for ( Iterator<JaxbNamedQuery> 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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<XMLQueryHint> constraints, List<AnnotationValue> annotationValueList) {
|
||||
private void nestedQueryHintList(String name, List<JaxbQueryHint> constraints, List<AnnotationValue> 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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
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<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
|
||||
MockHelper.stringValue( "name", generator.getName(), annotationValueList );
|
||||
MockHelper.stringValue( "catalog", generator.getCatalog(), annotationValueList );
|
||||
|
|
|
@ -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<String, XMLSequenceGenerator> sequenceGeneratorMap = new HashMap<String, XMLSequenceGenerator>();
|
||||
private Map<String, XMLTableGenerator> tableGeneratorMap = new HashMap<String, XMLTableGenerator>();
|
||||
private Map<String, XMLNamedQuery> namedQueryMap = new HashMap<String, XMLNamedQuery>();
|
||||
private Map<String, XMLNamedNativeQuery> namedNativeQueryMap = new HashMap<String, XMLNamedNativeQuery>();
|
||||
private Map<String, XMLSqlResultSetMapping> sqlResultSetMappingMap = new HashMap<String, XMLSqlResultSetMapping>();
|
||||
private Map<String, JaxbSequenceGenerator> sequenceGeneratorMap = new HashMap<String, JaxbSequenceGenerator>();
|
||||
private Map<String, JaxbTableGenerator> tableGeneratorMap = new HashMap<String, JaxbTableGenerator>();
|
||||
private Map<String, JaxbNamedQuery> namedQueryMap = new HashMap<String, JaxbNamedQuery>();
|
||||
private Map<String, JaxbNamedNativeQuery> namedNativeQueryMap = new HashMap<String, JaxbNamedNativeQuery>();
|
||||
private Map<String, JaxbSqlResultSetMapping> sqlResultSetMappingMap = new HashMap<String, JaxbSqlResultSetMapping>();
|
||||
private Map<DotName, List<AnnotationInstance>> annotationInstanceMap = new HashMap<DotName, List<AnnotationInstance>>();
|
||||
private List<AnnotationInstance> indexedAnnotationInstanceList = new ArrayList<AnnotationInstance>();
|
||||
//---------------------------
|
||||
|
@ -102,23 +102,23 @@ class GlobalAnnotations implements JPADotNames {
|
|||
.isEmpty() && sqlResultSetMappingMap.isEmpty() );
|
||||
}
|
||||
|
||||
Map<String, XMLNamedNativeQuery> getNamedNativeQueryMap() {
|
||||
Map<String, JaxbNamedNativeQuery> getNamedNativeQueryMap() {
|
||||
return namedNativeQueryMap;
|
||||
}
|
||||
|
||||
Map<String, XMLNamedQuery> getNamedQueryMap() {
|
||||
Map<String, JaxbNamedQuery> getNamedQueryMap() {
|
||||
return namedQueryMap;
|
||||
}
|
||||
|
||||
Map<String, XMLSequenceGenerator> getSequenceGeneratorMap() {
|
||||
Map<String, JaxbSequenceGenerator> getSequenceGeneratorMap() {
|
||||
return sequenceGeneratorMap;
|
||||
}
|
||||
|
||||
Map<String, XMLSqlResultSetMapping> getSqlResultSetMappingMap() {
|
||||
Map<String, JaxbSqlResultSetMapping> getSqlResultSetMappingMap() {
|
||||
return sqlResultSetMappingMap;
|
||||
}
|
||||
|
||||
Map<String, XMLTableGenerator> getTableGeneratorMap() {
|
||||
Map<String, JaxbTableGenerator> 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 ) {
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 <entity-listener> found under <entity-listeners>." );
|
||||
}
|
||||
List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>( 1 );
|
||||
List<String> clazzNameList = new ArrayList<String>( 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;
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 <mapped-superclass> 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<AnnotationValue> annotationValueList) {
|
||||
static void cascadeValue(String name, JaxbCascadeType cascadeType, boolean isCascadePersistDefault, List<AnnotationValue> annotationValueList) {
|
||||
List<Enum> enumList = new ArrayList<Enum>();
|
||||
if ( isCascadePersistDefault ) {
|
||||
enumList.add( javax.persistence.CascadeType.PERSIST );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<XMLMapKeyJoinColumn> columns, List<AnnotationValue> annotationValueList) {
|
||||
private AnnotationValue[] nestedMapKeyJoinColumnList(String name, List<JaxbMapKeyJoinColumn> columns, List<AnnotationValue> 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<XMLMapKeyJoinColumn> joinColumnList, AnnotationTarget target) {
|
||||
protected AnnotationInstance parserMapKeyJoinColumnList(List<JaxbMapKeyJoinColumn> 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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<String> getSynchronizedTableNames() {
|
||||
List<String> tableNames = new ArrayList<String>();
|
||||
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<AttributeSource> attributeSources() {
|
||||
List<AttributeSource> attributeSources = new ArrayList<AttributeSource>();
|
||||
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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<Class<?>> 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<AttributeSource> attributeSources() {
|
||||
List<AttributeSource> attributeSources = new ArrayList<AttributeSource>();
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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<XMLFetchProfileElement> fetchProfiles, String containingEntityName);
|
||||
public void processFetchProfiles(List<JaxbFetchProfileElement> fetchProfiles, String containingEntityName);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<XMLMetaElement> metaElementList,
|
||||
List<JaxbMetaElement> 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<String, String> extractParameters(List<XMLParamElement> xmlParamElements) {
|
||||
public static Map<String, String> extractParameters(List<JaxbParamElement> xmlParamElements) {
|
||||
if ( xmlParamElements == null || xmlParamElements.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
final HashMap<String,String> params = new HashMap<String, String>();
|
||||
for ( XMLParamElement paramElement : xmlParamElements ) {
|
||||
for ( JaxbParamElement paramElement : xmlParamElements ) {
|
||||
params.put( paramElement.getName(), paramElement.getValue() );
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public static Iterable<MetaAttributeSource> buildMetaAttributeSources(List<XMLMetaElement> metaElements) {
|
||||
public static Iterable<MetaAttributeSource> buildMetaAttributeSources(List<JaxbMetaElement> metaElements) {
|
||||
ArrayList<MetaAttributeSource> result = new ArrayList<MetaAttributeSource>();
|
||||
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()
|
||||
)
|
||||
|
|
|
@ -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<String> dialectScopes = new HashSet<String>();
|
||||
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<String, String> parameters = new HashMap<String, String>();
|
||||
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<String,Type> parameters = new HashMap<String, Type>();
|
||||
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<XMLFetchProfileElement> fetchProfiles, String containingEntityName) {
|
||||
for ( XMLFetchProfileElement fetchProfile : fetchProfiles ) {
|
||||
public void processFetchProfiles(List<JaxbFetchProfileElement> fetchProfiles, String containingEntityName) {
|
||||
for ( JaxbFetchProfileElement fetchProfile : fetchProfiles ) {
|
||||
String profileName = fetchProfile.getName();
|
||||
Set<FetchProfile.Fetch> fetches = new HashSet<FetchProfile.Fetch>();
|
||||
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 {
|
||||
|
|
|
@ -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 <class/> 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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<RelationalValueSource> valueSources;
|
||||
|
||||
public ManyToManyPluralAttributeElementSourceImpl(
|
||||
final XMLManyToManyElement manyToManyElement,
|
||||
final JaxbManyToManyElement manyToManyElement,
|
||||
final LocalBindingContext bindingContext) {
|
||||
this.manyToManyElement = manyToManyElement;
|
||||
this.bindingContext = bindingContext;
|
||||
|
|
|
@ -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 <many-to-one/> 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<RelationalValueSource> valueSources;
|
||||
|
||||
ManyToOneAttributeSourceImpl(final XMLManyToOneElement manyToOneElement, LocalBindingContext bindingContext) {
|
||||
ManyToOneAttributeSourceImpl(final JaxbManyToOneElement manyToOneElement, LocalBindingContext bindingContext) {
|
||||
this.manyToOneElement = manyToOneElement;
|
||||
this.bindingContext = bindingContext;
|
||||
this.valueSources = Helper.buildValueSources(
|
||||
|
|
|
@ -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<XMLHibernateMapping> hbmJaxbRoot;
|
||||
private final JaxbRoot<JaxbHibernateMapping> hbmJaxbRoot;
|
||||
private final LocalBindingContextImpl mappingLocalBindingContext;
|
||||
|
||||
public MappingDocument(JaxbRoot<XMLHibernateMapping> hbmJaxbRoot, MetadataImplementor metadata) {
|
||||
public MappingDocument(JaxbRoot<JaxbHibernateMapping> 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<XMLHibernateMapping> getJaxbRoot() {
|
||||
public JaxbRoot<JaxbHibernateMapping> getJaxbRoot() {
|
||||
return hbmJaxbRoot;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class MappingDocument {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processFetchProfiles(List<XMLFetchProfileElement> fetchProfiles, String containingEntityName) {
|
||||
public void processFetchProfiles(List<JaxbFetchProfileElement> fetchProfiles, String containingEntityName) {
|
||||
// todo : this really needs to not be part of the context
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<RelationalValueSource> valueSources;
|
||||
|
||||
public PluralAttributeKeySourceImpl(
|
||||
final XMLKeyElement keyElement,
|
||||
final JaxbKeyElement keyElement,
|
||||
final AttributeSourceContainer container) {
|
||||
this.keyElement = keyElement;
|
||||
|
||||
|
|
|
@ -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 <property/>} 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<RelationalValueSource> 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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <id/>} 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<RelationalValueSource> valueSources;
|
||||
|
||||
public SingularIdentifierAttributeSourceImpl(
|
||||
final XMLHibernateMapping.XMLClass.XMLId idElement,
|
||||
final JaxbHibernateMapping.JaxbClass.JaxbId idElement,
|
||||
LocalBindingContext bindingContext) {
|
||||
this.idElement = idElement;
|
||||
this.typeSource = new ExplicitHibernateTypeSource() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 <timestamp/>} 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<RelationalValueSource> valueSources;
|
||||
|
||||
TimestampAttributeSourceImpl(
|
||||
final XMLHibernateMapping.XMLClass.XMLTimestamp timestampElement,
|
||||
final JaxbHibernateMapping.JaxbClass.JaxbTimestamp timestampElement,
|
||||
LocalBindingContext bindingContext) {
|
||||
this.timestampElement = timestampElement;
|
||||
this.bindingContext = bindingContext;
|
||||
|
|
|
@ -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 <version/>} 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<RelationalValueSource> valueSources;
|
||||
|
||||
VersionAttributeSourceImpl(
|
||||
final XMLHibernateMapping.XMLClass.XMLVersion versionElement,
|
||||
final JaxbHibernateMapping.JaxbClass.JaxbVersion versionElement,
|
||||
LocalBindingContext bindingContext) {
|
||||
this.versionElement = versionElement;
|
||||
this.bindingContext = bindingContext;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() );
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
<jaxb:bindings schemaLocation="../resources/org/hibernate/hibernate-configuration-4.0.xsd" node="/xsd:schema">
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:nameXmlTransform>
|
||||
<jaxb:typeName prefix="XML"/>
|
||||
<jaxb:elementName prefix="XML"/>
|
||||
<jaxb:modelGroupName prefix="XML"/>
|
||||
<jaxb:anonymousTypeName prefix="XML"/>
|
||||
<jaxb:typeName prefix="Jaxb"/>
|
||||
<jaxb:elementName prefix="Jaxb"/>
|
||||
<jaxb:modelGroupName prefix="Jaxb"/>
|
||||
<jaxb:anonymousTypeName prefix="Jaxb"/>
|
||||
</jaxb:nameXmlTransform>
|
||||
</jaxb:schemaBindings>
|
||||
</jaxb:bindings>
|
||||
|
|
|
@ -10,70 +10,70 @@
|
|||
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:nameXmlTransform>
|
||||
<jaxb:typeName prefix="XML"/>
|
||||
<jaxb:elementName prefix="XML"/>
|
||||
<jaxb:modelGroupName prefix="XML"/>
|
||||
<jaxb:anonymousTypeName prefix="XML"/>
|
||||
<jaxb:typeName prefix="Jaxb"/>
|
||||
<jaxb:elementName prefix="Jaxb"/>
|
||||
<jaxb:modelGroupName prefix="Jaxb"/>
|
||||
<jaxb:anonymousTypeName prefix="Jaxb"/>
|
||||
</jaxb:nameXmlTransform>
|
||||
</jaxb:schemaBindings>
|
||||
|
||||
<!-- Mix-ins -->
|
||||
<jaxb:bindings node="//xsd:element[@name='class']/xsd:complexType">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.EntityElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.JoinElementSource</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.EntityElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.JoinElementSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='subclass-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.JoinElementSource</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.JoinElementSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='joined-subclass-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='union-subclass-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SubEntityElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SubEntityElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-insert-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-update-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-delete-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-delete-all-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.CustomSqlElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xsd:complexType[@name='property-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SingularAttributeSource</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:element[@name='id']/xsd:complexType">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SingularAttributeSource</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<!--
|
||||
<jaxb:bindings node="//xsd:element[@name='version']/xsd:complexType">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SingularAttributeSource</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:element[@name='timestamp']/xsd:complexType">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.SingularAttributeSource</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
-->
|
||||
<jaxb:bindings node="//xsd:complexType[@name='bag-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='idbag-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:extends>org.hibernate.metamodel.source.hbm.jaxb.mapping.IdBagPluralAttributeElementAdapter</inheritance:extends>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:extends>org.hibernate.internal.jaxb.mapping.hbm.IdBagPluralAttributeElementAdapter</inheritance:extends>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='list-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='map-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='set-element']">
|
||||
<inheritance:implements>org.hibernate.metamodel.source.hbm.jaxb.mapping.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
<jaxb:bindings schemaLocation="../resources/org/hibernate/ejb/orm_2_0.xsd" node="/xsd:schema">
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:nameXmlTransform>
|
||||
<jaxb:typeName prefix="XML"/>
|
||||
<jaxb:elementName prefix="XML"/>
|
||||
<jaxb:modelGroupName prefix="XML"/>
|
||||
<jaxb:anonymousTypeName prefix="XML"/>
|
||||
<jaxb:typeName prefix="Jaxb"/>
|
||||
<jaxb:elementName prefix="Jaxb"/>
|
||||
<jaxb:modelGroupName prefix="Jaxb"/>
|
||||
<jaxb:anonymousTypeName prefix="Jaxb"/>
|
||||
</jaxb:nameXmlTransform>
|
||||
</jaxb:schemaBindings>
|
||||
</jaxb:bindings>
|
||||
|
|
|
@ -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<XMLEntityMappings> xmlEntityMappingsList = new ArrayList<XMLEntityMappings>();
|
||||
List<JaxbEntityMappings> xmlEntityMappingsList = new ArrayList<JaxbEntityMappings>();
|
||||
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 ) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue