renamed `SingularAssociationAttributeMapping` to `ToOneAttributeMapping`
This commit is contained in:
parent
b06c341d8a
commit
d3f6f46980
|
@ -27,7 +27,7 @@ import org.hibernate.mapping.Component;
|
|||
import org.hibernate.mapping.Property;
|
||||
import org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper;
|
||||
import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.metamodel.model.domain.NavigableRole;
|
||||
import org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy;
|
||||
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
||||
|
@ -224,7 +224,7 @@ public class EmbeddableMappingType implements ManagedMappingType {
|
|||
);
|
||||
}
|
||||
else if ( subtype instanceof EntityType ) {
|
||||
final SingularAssociationAttributeMapping singularAssociationAttributeMapping = MappingModelCreationHelper.buildSingularAssociationAttributeMapping(
|
||||
final ToOneAttributeMapping toOneAttributeMapping = MappingModelCreationHelper.buildSingularAssociationAttributeMapping(
|
||||
bootPropertyDescriptor.getName(),
|
||||
valueMapping.getNavigableRole().append( bootPropertyDescriptor.getName() ),
|
||||
attributeIndex,
|
||||
|
@ -235,7 +235,7 @@ public class EmbeddableMappingType implements ManagedMappingType {
|
|||
compositeType.getCascadeStyle( attributeIndex ),
|
||||
creationProcess
|
||||
);
|
||||
attributeMappings.put( bootPropertyDescriptor.getName(), singularAssociationAttributeMapping );
|
||||
attributeMappings.put( bootPropertyDescriptor.getName(), toOneAttributeMapping );
|
||||
// todo (6.0) : not sure it is always correct
|
||||
columnPosition++;
|
||||
}
|
||||
|
|
|
@ -67,8 +67,8 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor, Model
|
|||
attribute -> {
|
||||
final TypeConfiguration typeConfiguration = creationProcess.getCreationContext()
|
||||
.getTypeConfiguration();
|
||||
if ( attribute instanceof SingularAssociationAttributeMapping ) {
|
||||
SingularAssociationAttributeMapping associationAttributeMapping = (SingularAssociationAttributeMapping) attribute;
|
||||
if ( attribute instanceof ToOneAttributeMapping ) {
|
||||
ToOneAttributeMapping associationAttributeMapping = (ToOneAttributeMapping) attribute;
|
||||
associationAttributeMapping.getAssociatedEntityMappingType()
|
||||
.getEntityPersister()
|
||||
.getIdentifierMapping()
|
||||
|
|
|
@ -172,9 +172,9 @@ public class EmbeddedIdentifierMappingImpl implements CompositeIdentifierMapping
|
|||
getEmbeddableTypeDescriptor().getAttributeMappings().forEach(
|
||||
attributeMapping -> {
|
||||
final Object o = attributeMapping.getPropertyAccess().getGetter().get( value );
|
||||
if ( attributeMapping instanceof SingularAssociationAttributeMapping ) {
|
||||
if ( attributeMapping instanceof ToOneAttributeMapping ) {
|
||||
final EntityMappingType associatedEntityMappingType =
|
||||
( (SingularAssociationAttributeMapping) attributeMapping ).getAssociatedEntityMappingType();
|
||||
( (ToOneAttributeMapping) attributeMapping ).getAssociatedEntityMappingType();
|
||||
final EntityIdentifierMapping identifierMapping =
|
||||
associatedEntityMappingType.getIdentifierMapping();
|
||||
final Object identifier = identifierMapping.getIdentifier( o, session );
|
||||
|
@ -318,8 +318,8 @@ public class EmbeddedIdentifierMappingImpl implements CompositeIdentifierMapping
|
|||
public void visitColumns(ColumnConsumer consumer) {
|
||||
getAttributes().forEach(
|
||||
attribute -> {
|
||||
if ( attribute instanceof SingularAssociationAttributeMapping ) {
|
||||
final SingularAssociationAttributeMapping associationAttributeMapping = (SingularAssociationAttributeMapping) attribute;
|
||||
if ( attribute instanceof ToOneAttributeMapping ) {
|
||||
final ToOneAttributeMapping associationAttributeMapping = (ToOneAttributeMapping) attribute;
|
||||
associationAttributeMapping.getForeignKeyDescriptor().visitReferringColumns( consumer );
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -833,8 +833,8 @@ public class MappingModelCreationHelper {
|
|||
attributeMappingSubPart = attributeMapping.findSubPart( collectionDescriptor.getMappedByProperty(), null );
|
||||
}
|
||||
|
||||
if ( attributeMappingSubPart != null && attributeMappingSubPart instanceof SingularAssociationAttributeMapping ) {
|
||||
final SingularAssociationAttributeMapping referencedAttributeMapping = (SingularAssociationAttributeMapping) attributeMappingSubPart;
|
||||
if ( attributeMappingSubPart != null && attributeMappingSubPart instanceof ToOneAttributeMapping ) {
|
||||
final ToOneAttributeMapping referencedAttributeMapping = (ToOneAttributeMapping) attributeMappingSubPart;
|
||||
|
||||
setRefererencedAttributeForeignKeyDescriptor(
|
||||
attributeMapping,
|
||||
|
@ -892,7 +892,7 @@ public class MappingModelCreationHelper {
|
|||
}
|
||||
|
||||
public static void interpretSingularAssociationAttributeMappingKeyDescriptor(
|
||||
SingularAssociationAttributeMapping attributeMapping,
|
||||
ToOneAttributeMapping attributeMapping,
|
||||
Property bootProperty,
|
||||
ToOne bootValueMapping,
|
||||
EntityMappingType declaringEntityDescriptor,
|
||||
|
@ -915,8 +915,8 @@ public class MappingModelCreationHelper {
|
|||
}
|
||||
|
||||
if ( referencedPropertyName != null ) {
|
||||
final SingularAssociationAttributeMapping referencedAttributeMapping =
|
||||
(SingularAssociationAttributeMapping) referencedEntityDescriptor.findSubPart( referencedPropertyName );
|
||||
final ToOneAttributeMapping referencedAttributeMapping =
|
||||
(ToOneAttributeMapping) referencedEntityDescriptor.findSubPart( referencedPropertyName );
|
||||
|
||||
setRefererencedAttributeForeignKeyDescriptor(
|
||||
attributeMapping,
|
||||
|
@ -1006,7 +1006,7 @@ public class MappingModelCreationHelper {
|
|||
|
||||
private static void setRefererencedAttributeForeignKeyDescriptor(
|
||||
AbstractAttributeMapping attributeMapping,
|
||||
SingularAssociationAttributeMapping referencedAttributeMapping,
|
||||
ToOneAttributeMapping referencedAttributeMapping,
|
||||
EntityPersister referencedEntityDescriptor,
|
||||
String referencedPropertyName,
|
||||
Dialect dialect,
|
||||
|
@ -1253,7 +1253,7 @@ public class MappingModelCreationHelper {
|
|||
}
|
||||
}
|
||||
|
||||
public static SingularAssociationAttributeMapping buildSingularAssociationAttributeMapping(
|
||||
public static ToOneAttributeMapping buildSingularAssociationAttributeMapping(
|
||||
String attrName,
|
||||
NavigableRole navigableRole,
|
||||
int stateArrayPosition,
|
||||
|
@ -1296,7 +1296,7 @@ public class MappingModelCreationHelper {
|
|||
|
||||
final FetchStrategy fetchStrategy = new FetchStrategy( fetchTiming, fetchStyle );
|
||||
|
||||
final SingularAssociationAttributeMapping attributeMapping = new SingularAssociationAttributeMapping(
|
||||
final ToOneAttributeMapping attributeMapping = new ToOneAttributeMapping(
|
||||
attrName,
|
||||
navigableRole,
|
||||
stateArrayPosition,
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.hibernate.type.ForeignKeyDirection;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public class SingularAssociationAttributeMapping extends AbstractSingularAttributeMapping
|
||||
public class ToOneAttributeMapping extends AbstractSingularAttributeMapping
|
||||
implements EntityValuedFetchable, EntityAssociationMapping, Association, TableGroupJoinProducer {
|
||||
|
||||
public enum Cardinality {
|
||||
|
@ -80,7 +80,7 @@ public class SingularAssociationAttributeMapping extends AbstractSingularAttribu
|
|||
private ForeignKeyDirection foreignKeyDirection;
|
||||
private String identifyingColumnsTableExpression;
|
||||
|
||||
public SingularAssociationAttributeMapping(
|
||||
public ToOneAttributeMapping(
|
||||
String name,
|
||||
NavigableRole navigableRole,
|
||||
int stateArrayPosition,
|
||||
|
@ -209,8 +209,8 @@ public class SingularAssociationAttributeMapping extends AbstractSingularAttribu
|
|||
// while the getIdentifyingColumnExpressions for this association is PARENT_CHILD.child_id
|
||||
// so we will check if the parentAssociation ForeignKey Target match with the association entity identifier table and columns
|
||||
final ForeignKeyDescriptor associationParentForeignKeyDescriptor = associationParent.getForeignKeyDescriptor();
|
||||
if ( referencedModePart instanceof SingularAssociationAttributeMapping
|
||||
&& ( (SingularAssociationAttributeMapping) referencedModePart ).getDeclaringType() == getPartMappingType() ) {
|
||||
if ( referencedModePart instanceof ToOneAttributeMapping
|
||||
&& ( (ToOneAttributeMapping) referencedModePart ).getDeclaringType() == getPartMappingType() ) {
|
||||
if ( this.foreignKeyDescriptor.getReferringTableExpression()
|
||||
.equals( associationParentForeignKeyDescriptor.getReferringTableExpression() ) ) {
|
||||
final SingleTableEntityPersister entityPersister = (SingleTableEntityPersister) getDeclaringType();
|
|
@ -76,7 +76,6 @@ import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
|||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||
import org.hibernate.engine.spi.CachedNaturalIdValueSource;
|
||||
import org.hibernate.engine.spi.CascadeStyle;
|
||||
import org.hibernate.engine.spi.CascadeStyles;
|
||||
import org.hibernate.engine.spi.CollectionKey;
|
||||
import org.hibernate.engine.spi.EntityEntry;
|
||||
import org.hibernate.engine.spi.EntityEntryFactory;
|
||||
|
@ -151,7 +150,7 @@ import org.hibernate.metamodel.mapping.internal.EntityVersionMappingImpl;
|
|||
import org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType;
|
||||
import org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper;
|
||||
import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.metamodel.model.domain.NavigableRole;
|
||||
import org.hibernate.metamodel.spi.EntityRepresentationStrategy;
|
||||
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
||||
|
@ -169,7 +168,6 @@ import org.hibernate.query.ComparisonOperator;
|
|||
import org.hibernate.query.NavigablePath;
|
||||
import org.hibernate.query.sqm.mutation.internal.SqmMutationStrategyHelper;
|
||||
import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy;
|
||||
import org.hibernate.query.sqm.sql.SqmToSqlAstConverter;
|
||||
import org.hibernate.sql.Alias;
|
||||
import org.hibernate.sql.Delete;
|
||||
import org.hibernate.sql.Insert;
|
||||
|
@ -211,7 +209,6 @@ import org.hibernate.tuple.ValueGeneration;
|
|||
import org.hibernate.tuple.entity.EntityBasedAssociationAttribute;
|
||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||
import org.hibernate.tuple.entity.EntityTuplizer;
|
||||
import org.hibernate.type.AnyType;
|
||||
import org.hibernate.type.AssociationType;
|
||||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.CollectionType;
|
||||
|
@ -6181,7 +6178,7 @@ public abstract class AbstractEntityPersister
|
|||
);
|
||||
}
|
||||
else if ( attrType instanceof EntityType ) {
|
||||
SingularAssociationAttributeMapping attributeMapping = MappingModelCreationHelper.buildSingularAssociationAttributeMapping(
|
||||
ToOneAttributeMapping attributeMapping = MappingModelCreationHelper.buildSingularAssociationAttributeMapping(
|
||||
attrName,
|
||||
getNavigableRole().append( attrName ),
|
||||
stateArrayPosition,
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.List;
|
|||
|
||||
import org.hibernate.metamodel.mapping.Association;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.query.NavigablePath;
|
||||
|
||||
/**
|
||||
|
@ -44,7 +45,7 @@ public interface FetchParent extends DomainResultGraphNode {
|
|||
* referenced container type, this method returns the referenced part.
|
||||
*
|
||||
* E.g. for a many-to-one this methods returns the
|
||||
* {@link org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping} while
|
||||
* {@link ToOneAttributeMapping} while
|
||||
* {@link #getReferencedMappingContainer} and {@link #getReferencedMappingType} return the referenced
|
||||
* {@link org.hibernate.metamodel.mapping.EntityMappingType}.
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
|||
import org.hibernate.metamodel.mapping.EmbeddableMappingType;
|
||||
import org.hibernate.metamodel.mapping.EmbeddableValuedModelPart;
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.query.NavigablePath;
|
||||
import org.hibernate.sql.ast.spi.SqlSelection;
|
||||
import org.hibernate.sql.results.graph.AbstractFetchParent;
|
||||
|
@ -66,19 +66,19 @@ public class EmbeddableForeignKeyResultImpl<T>
|
|||
DomainResultCreationState creationState,
|
||||
MutableInteger mutableInteger,
|
||||
Fetchable fetchable) {
|
||||
if ( fetchable instanceof SingularAssociationAttributeMapping ) {
|
||||
final SingularAssociationAttributeMapping singularAssociationAttributeMapping = (SingularAssociationAttributeMapping) fetchable;
|
||||
EntityMappingType associatedEntityMappingType = singularAssociationAttributeMapping.getAssociatedEntityMappingType();
|
||||
if ( fetchable instanceof ToOneAttributeMapping ) {
|
||||
final ToOneAttributeMapping toOneAttributeMapping = (ToOneAttributeMapping) fetchable;
|
||||
EntityMappingType associatedEntityMappingType = toOneAttributeMapping.getAssociatedEntityMappingType();
|
||||
BasicResult domainResult = new BasicResult(
|
||||
sqlSelections.get( mutableInteger.getAndIncrement() ).getValuesArrayPosition(),
|
||||
null,
|
||||
associatedEntityMappingType.getIdentifierMapping().getJavaTypeDescriptor()
|
||||
);
|
||||
Fetch fetch;
|
||||
if ( singularAssociationAttributeMapping.getMappedFetchStrategy().getTiming() == FetchTiming.DELAYED ) {
|
||||
if ( toOneAttributeMapping.getMappedFetchStrategy().getTiming() == FetchTiming.DELAYED ) {
|
||||
fetch = new EntityFetchDelayedImpl(
|
||||
this,
|
||||
singularAssociationAttributeMapping,
|
||||
toOneAttributeMapping,
|
||||
null,
|
||||
false,
|
||||
navigablePath.append( fetchable.getFetchableName() ),
|
||||
|
@ -88,7 +88,7 @@ public class EmbeddableForeignKeyResultImpl<T>
|
|||
else {
|
||||
fetch = new EntityFetchSelectImpl(
|
||||
this,
|
||||
singularAssociationAttributeMapping,
|
||||
toOneAttributeMapping,
|
||||
null,
|
||||
false,
|
||||
navigablePath.append( fetchable.getFetchableName() ),
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.sql.results.graph.entity.internal;
|
|||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.engine.FetchTiming;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.query.NavigablePath;
|
||||
import org.hibernate.sql.results.graph.AssemblerCreationState;
|
||||
import org.hibernate.sql.results.graph.DomainResult;
|
||||
|
@ -29,7 +29,7 @@ public class EntityFetchDelayedImpl extends AbstractNonJoinedEntityFetch {
|
|||
|
||||
public EntityFetchDelayedImpl(
|
||||
FetchParent fetchParent,
|
||||
SingularAssociationAttributeMapping fetchedAttribute,
|
||||
ToOneAttributeMapping fetchedAttribute,
|
||||
LockMode lockMode,
|
||||
boolean nullable,
|
||||
NavigablePath navigablePath,
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.sql.results.graph.entity.internal;
|
|||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.engine.FetchTiming;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.query.NavigablePath;
|
||||
import org.hibernate.sql.results.graph.AssemblerCreationState;
|
||||
import org.hibernate.sql.results.graph.DomainResult;
|
||||
|
@ -29,7 +29,7 @@ public class EntityFetchSelectImpl extends AbstractNonJoinedEntityFetch {
|
|||
|
||||
public EntityFetchSelectImpl(
|
||||
FetchParent fetchParent,
|
||||
SingularAssociationAttributeMapping fetchedAttribute,
|
||||
ToOneAttributeMapping fetchedAttribute,
|
||||
LockMode lockMode,
|
||||
boolean nullable,
|
||||
NavigablePath navigablePath,
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
package org.hibernate.sql.results.graph.entity.internal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.metamodel.mapping.EntityDiscriminatorMapping;
|
||||
|
@ -17,7 +16,7 @@ import org.hibernate.metamodel.mapping.EntityValuedModelPart;
|
|||
import org.hibernate.metamodel.mapping.EntityVersionMapping;
|
||||
import org.hibernate.metamodel.mapping.ManagedMappingType;
|
||||
import org.hibernate.metamodel.mapping.internal.SingleAttributeIdentifierMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.query.NavigablePath;
|
||||
import org.hibernate.sql.ast.tree.from.TableGroup;
|
||||
import org.hibernate.sql.results.graph.AbstractFetchParent;
|
||||
|
@ -26,7 +25,6 @@ import org.hibernate.sql.results.graph.DomainResult;
|
|||
import org.hibernate.sql.results.graph.DomainResultAssembler;
|
||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||
import org.hibernate.sql.results.graph.FetchableContainer;
|
||||
import org.hibernate.sql.results.graph.Initializer;
|
||||
import org.hibernate.sql.results.graph.entity.EntityInitializer;
|
||||
import org.hibernate.sql.results.graph.entity.EntityResult;
|
||||
import org.hibernate.sql.results.graph.entity.EntityResultGraphNode;
|
||||
|
@ -119,8 +117,8 @@ public class RootEntityResultImpl extends AbstractFetchParent implements EntityR
|
|||
fetches = new ArrayList<>();
|
||||
mappingType.visitAttributeMappings(
|
||||
attributeMapping -> {
|
||||
if ( attributeMapping instanceof SingularAssociationAttributeMapping ) {
|
||||
((SingularAssociationAttributeMapping)attributeMapping).getForeignKeyDescriptor().createDomainResult(
|
||||
if ( attributeMapping instanceof ToOneAttributeMapping ) {
|
||||
((ToOneAttributeMapping)attributeMapping).getForeignKeyDescriptor().createDomainResult(
|
||||
navigablePath.append( EntityIdentifierMapping.ROLE_LOCAL_NAME ),
|
||||
entityTableGroup,
|
||||
null,
|
||||
|
|
|
@ -9,14 +9,12 @@ package org.hibernate.orm.test.bootstrap.binding.hbm.cid.nonaggregated.dynamic;
|
|||
import org.hibernate.boot.MetadataSources;
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.metamodel.mapping.AttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.BasicValuedSingularAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.NonAggregatedIdentifierMappingImpl;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.tool.schema.Action;
|
||||
|
||||
import org.hibernate.testing.orm.junit.ServiceRegistry;
|
||||
import org.hibernate.testing.orm.junit.ServiceRegistryScope;
|
||||
|
@ -63,7 +61,7 @@ public class DynamicCompositeIdManyToOneTests {
|
|||
|
||||
final AttributeMapping key2 = cid.getEmbeddableTypeDescriptor().findAttributeMapping( "key2" );
|
||||
assertThat( key2, notNullValue() );
|
||||
assertThat( key2, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( key2, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final AttributeMapping attr1 = entityDescriptor.findAttributeMapping( "attr1" );
|
||||
assertThat( attr1, notNullValue() );
|
||||
|
|
|
@ -21,14 +21,11 @@ import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
|||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.BasicValuedSingularAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.metamodel.model.convert.internal.NamedEnumValueConverter;
|
||||
import org.hibernate.metamodel.model.convert.internal.OrdinalEnumValueConverter;
|
||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||
import org.hibernate.metamodel.model.convert.spi.EnumValueConverter;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.type.CustomType;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
import org.hibernate.testing.hamcrest.CollectionMatchers;
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
|
@ -131,8 +128,8 @@ public class SmokeTests {
|
|||
|
||||
final ModelPart part = entityDescriptor.findSubPart( "simpleEntity" );
|
||||
assertThat( part, notNullValue() );
|
||||
assertThat( part, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
final SingularAssociationAttributeMapping attrMapping = (SingularAssociationAttributeMapping) part;
|
||||
assertThat( part, instanceOf( ToOneAttributeMapping.class ) );
|
||||
final ToOneAttributeMapping attrMapping = (ToOneAttributeMapping) part;
|
||||
assertThat( attrMapping.getAttributeName(), is( "simpleEntity" ) );
|
||||
assertThat( attrMapping.getMappedTypeDescriptor(), is( simpleEntityDescriptor ) );
|
||||
assertThat(
|
||||
|
|
|
@ -16,7 +16,7 @@ import javax.persistence.Table;
|
|||
|
||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
|
@ -51,9 +51,9 @@ public class ManyToOneJoinTableTest {
|
|||
|
||||
final ModelPart simpleEntityAssociation = otherDescriptor.findSubPart( "simpleEntity" );
|
||||
|
||||
assertThat( simpleEntityAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( simpleEntityAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping simpleAttributeMapping = (SingularAssociationAttributeMapping) simpleEntityAssociation;
|
||||
final ToOneAttributeMapping simpleAttributeMapping = (ToOneAttributeMapping) simpleEntityAssociation;
|
||||
|
||||
ForeignKeyDescriptor foreignKeyDescriptor = simpleAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
@ -68,9 +68,9 @@ public class ManyToOneJoinTableTest {
|
|||
|
||||
final ModelPart anotherEntityAssociation = otherDescriptor.findSubPart( "anotherEntity" );
|
||||
|
||||
assertThat( anotherEntityAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( anotherEntityAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping anotherAttributeMapping = (SingularAssociationAttributeMapping) anotherEntityAssociation;
|
||||
final ToOneAttributeMapping anotherAttributeMapping = (ToOneAttributeMapping) anotherEntityAssociation;
|
||||
|
||||
foreignKeyDescriptor = anotherAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
@ -90,9 +90,9 @@ public class ManyToOneJoinTableTest {
|
|||
|
||||
ModelPart otherEntityEntityAssociation = simpleDescriptor.findSubPart( "other" );
|
||||
|
||||
assertThat( otherEntityEntityAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( otherEntityEntityAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
SingularAssociationAttributeMapping otherAttributeMapping = (SingularAssociationAttributeMapping) otherEntityEntityAssociation;
|
||||
ToOneAttributeMapping otherAttributeMapping = (ToOneAttributeMapping) otherEntityEntityAssociation;
|
||||
|
||||
foreignKeyDescriptor = otherAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
@ -112,9 +112,9 @@ public class ManyToOneJoinTableTest {
|
|||
|
||||
otherEntityEntityAssociation = anotherDescriptor.findSubPart( "other" );
|
||||
|
||||
assertThat( otherEntityEntityAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( otherEntityEntityAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
otherAttributeMapping = (SingularAssociationAttributeMapping) otherEntityEntityAssociation;
|
||||
otherAttributeMapping = (ToOneAttributeMapping) otherEntityEntityAssociation;
|
||||
|
||||
foreignKeyDescriptor = otherAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
|
|
@ -14,7 +14,7 @@ import javax.persistence.Table;
|
|||
|
||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
|
@ -48,9 +48,9 @@ public class ManyToOneTest {
|
|||
|
||||
final ModelPart simpleEntityAssociation = otherDescriptor.findSubPart( "simpleEntity" );
|
||||
|
||||
assertThat( simpleEntityAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( simpleEntityAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping childAttributeMapping = (SingularAssociationAttributeMapping) simpleEntityAssociation;
|
||||
final ToOneAttributeMapping childAttributeMapping = (ToOneAttributeMapping) simpleEntityAssociation;
|
||||
|
||||
ForeignKeyDescriptor foreignKeyDescriptor = childAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
|
|
@ -13,7 +13,7 @@ import javax.persistence.Table;
|
|||
|
||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
|
@ -46,9 +46,9 @@ public class EntityWithBidirectionalAssociationTest {
|
|||
|
||||
final ModelPart childAssociation = parentDescriptor.findSubPart( "child" );
|
||||
|
||||
assertThat( childAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( childAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping childAttributeMapping = (SingularAssociationAttributeMapping) childAssociation;
|
||||
final ToOneAttributeMapping childAttributeMapping = (ToOneAttributeMapping) childAssociation;
|
||||
|
||||
ForeignKeyDescriptor foreignKeyDescriptor = childAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
@ -67,9 +67,9 @@ public class EntityWithBidirectionalAssociationTest {
|
|||
|
||||
final ModelPart parentAssociation = childDescriptor.findSubPart( "parent" );
|
||||
|
||||
assertThat( parentAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( parentAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping parentAttributeMapping = (SingularAssociationAttributeMapping) parentAssociation;
|
||||
final ToOneAttributeMapping parentAttributeMapping = (ToOneAttributeMapping) parentAssociation;
|
||||
|
||||
foreignKeyDescriptor = parentAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
|
|
@ -15,7 +15,7 @@ import javax.persistence.Table;
|
|||
|
||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
|
@ -48,9 +48,9 @@ public class EntityWithOneBidirectionalJoinTableAssociationTest {
|
|||
|
||||
final ModelPart childAssociation = parentDescriptor.findSubPart( "child" );
|
||||
|
||||
assertThat( childAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( childAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping childAttributeMapping = (SingularAssociationAttributeMapping) childAssociation;
|
||||
final ToOneAttributeMapping childAttributeMapping = (ToOneAttributeMapping) childAssociation;
|
||||
|
||||
ForeignKeyDescriptor foreignKeyDescriptor = childAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
@ -69,9 +69,9 @@ public class EntityWithOneBidirectionalJoinTableAssociationTest {
|
|||
|
||||
final ModelPart parentAssociation = childDescriptor.findSubPart( "parent" );
|
||||
|
||||
assertThat( parentAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( parentAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping parentAttributeMapping = (SingularAssociationAttributeMapping) parentAssociation;
|
||||
final ToOneAttributeMapping parentAttributeMapping = (ToOneAttributeMapping) parentAssociation;
|
||||
|
||||
foreignKeyDescriptor = parentAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.orm.test.metamodel.mapping.onetoone;
|
|||
|
||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityWithOneToOneJoinTable;
|
||||
|
@ -42,9 +42,9 @@ public class EntityWithOneToOneJoinTableTest {
|
|||
.getMetamodel()
|
||||
.findEntityDescriptor( EntityWithOneToOneJoinTable.class );
|
||||
final ModelPart other = entityWithOneToOneJoinTableDescriptor.findSubPart( "other" );
|
||||
assertThat( other, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( other, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping otherAttributeMapping = (SingularAssociationAttributeMapping) other;
|
||||
final ToOneAttributeMapping otherAttributeMapping = (ToOneAttributeMapping) other;
|
||||
|
||||
final ForeignKeyDescriptor foreignKeyDescriptor = otherAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.orm.test.metamodel.mapping.onetoone;
|
|||
|
||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.internal.SingularAssociationAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityWithOneToOneSharingPrimaryKey;
|
||||
|
@ -43,9 +43,9 @@ public class EntityWithOneToOneSharingPrimaryKeyTest {
|
|||
|
||||
final ModelPart otherAssociation = entityDescriptor.findSubPart( "other" );
|
||||
|
||||
assertThat( otherAssociation, instanceOf( SingularAssociationAttributeMapping.class ) );
|
||||
assertThat( otherAssociation, instanceOf( ToOneAttributeMapping.class ) );
|
||||
|
||||
final SingularAssociationAttributeMapping otherAttributeMapping = (SingularAssociationAttributeMapping) otherAssociation;
|
||||
final ToOneAttributeMapping otherAttributeMapping = (ToOneAttributeMapping) otherAssociation;
|
||||
|
||||
ForeignKeyDescriptor foreignKeyDescriptor = otherAttributeMapping.getForeignKeyDescriptor();
|
||||
foreignKeyDescriptor.visitReferringColumns( (keyTable, keyColumn, jdbcMapping) -> {
|
||||
|
|
Loading…
Reference in New Issue