design doc work
This commit is contained in:
parent
f5ba3c22a0
commit
57a3b0b456
|
@ -5,12 +5,12 @@ no references to tables, columns, etc. The base contract for Hibernate's extens
|
||||||
JPA model is `org.hibernate.metamodel.model.domain.DomainType`.
|
JPA model is `org.hibernate.metamodel.model.domain.DomainType`.
|
||||||
|
|
||||||
Hibernate's Semantic Query Model (SQM) is defined in terms of these JPA type extensions,
|
Hibernate's Semantic Query Model (SQM) is defined in terms of these JPA type extensions,
|
||||||
through the `org.hibernate.query.sqm.SqmExpressable` contract allowing parts of the application's
|
through the `org.hibernate.query.sqm.SqmExpressable` contract, allowing parts of the application's
|
||||||
domain model to be used as part of an SQM tree.
|
domain model to be used as part of an SQM tree.
|
||||||
|
|
||||||
|
|
||||||
[plantuml,SqmTypeSystem,png]
|
[plantuml,SqmTypeSystem,png]
|
||||||
.Domain (JPA/SQM) type system
|
.Domain type system
|
||||||
....
|
....
|
||||||
@startuml
|
@startuml
|
||||||
skinparam handwritten true
|
skinparam handwritten true
|
||||||
|
|
|
@ -1,80 +1,57 @@
|
||||||
= Mapping model
|
= Mapping model
|
||||||
|
|
||||||
[plantuml,SqmTypeSystem,png]
|
The mapping model encompasses the complete mapping of objects to/from database. It is the
|
||||||
.Mapping type system
|
model used to drive read and write operations.
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
----
|
||||||
|
As of 6.0, only read operations are implemented to use this mapping model. Future versions will hopefully
|
||||||
|
move writing to use this mapping model as well
|
||||||
|
----
|
||||||
|
|
||||||
|
[plantuml,MasppingTypeSystem,png]
|
||||||
|
.Mapping type model (org.hibernate.metamodel.mapping)
|
||||||
....
|
....
|
||||||
@startuml
|
@startuml
|
||||||
skinparam handwritten true
|
skinparam handwritten true
|
||||||
|
|
||||||
interface MappingType
|
interface MappingType
|
||||||
|
interface ManagedMappingType
|
||||||
|
|
||||||
|
interface MappingModelExpressable
|
||||||
interface ValueMapping
|
interface ValueMapping
|
||||||
interface BasicType
|
interface BasicType
|
||||||
interface ModelPart
|
interface ModelPart
|
||||||
interface ModelPartContainer
|
interface ModelPartContainer
|
||||||
|
|
||||||
MappingType <|--
|
MappingType <|-- BasicType
|
||||||
|
MappingType <|-- JdbcMapping
|
||||||
|
MappingType <|-- ManagedMappingType
|
||||||
|
MappingType <|-- CollectionMappingType
|
||||||
|
|
||||||
|
ManagedMappingType <|-- EmbeddableMappingType
|
||||||
|
ManagedMappingType <|-- EntityMappingType
|
||||||
|
|
||||||
|
MappingModelExpressable <|-- ValueMapping
|
||||||
|
MappingModelExpressable <|-- ModelPart
|
||||||
|
|
||||||
ValueMapping <|-- BasicType
|
ValueMapping <|-- BasicType
|
||||||
ValueMapping <|-- ModelPart
|
|
||||||
ModelPartContainer <|-- EntityMapping
|
ModelPart <|-- BasicValuedModelPart
|
||||||
ModelPartContainer <|-- EmbeddableMapping
|
ModelPart <|-- EmbeddableValuedModelPart
|
||||||
ModelPart <|-- EmbeddableMapping
|
ModelPart <|-- EntityValuedModelPart
|
||||||
ModelPart <|-- AttributeMapping
|
ModelPart <|-- AttributeMapping
|
||||||
ModelPart <|-- EntityIdentifierMapping
|
ModelPart <|-- EntityIdentifierMapping
|
||||||
ModelPart <|-- EntityVersionMapping
|
ModelPart <|-- EntityVersionMapping
|
||||||
ModelPart <|-- EntityDiscriminatorMapping
|
ModelPart <|-- EntityDiscriminatorMapping
|
||||||
|
ModelPart <|-- CollectionPart
|
||||||
|
|
||||||
|
ModelPartContainer <|-- EntityMappingType
|
||||||
|
ModelPartContainer <|-- EmbeddableMappingType
|
||||||
|
|
||||||
@enduml
|
@enduml
|
||||||
....
|
....
|
||||||
|
|
||||||
[source,JAVA]
|
|
||||||
----
|
|
||||||
interface ValueMapping {
|
|
||||||
Type getMappingType();
|
|
||||||
<X> X getCapability(Class<X> capabilityType);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModelPart extends ValueMapping {
|
|
||||||
<T> DomainResult<T> createDomainResult(...);
|
|
||||||
void applySqlSelections(...);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModelPartContainer extends ValueMapping {
|
|
||||||
void visitSubMappings(Consumer<ModelPart> action);
|
|
||||||
ModelPart findSubPart(String name);
|
|
||||||
ModelPart resolveSubPart(String path);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EntityMapping extends ModelPartContainer {
|
|
||||||
default EntityPersister getEntityPersister() {
|
|
||||||
return getCapability( EntityPersister.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
default EntityIdentifierMapping getIdentifierMapping() {
|
|
||||||
return getCapability( EntityIdentifierMapping.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
default EntityVersionMapping getVersionMapping() {
|
|
||||||
return getCapability( EntityVersionMapping.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
default EntityDiscriminatorMapping getDiscriminatorMapping() {
|
|
||||||
return getCapability( EntityDiscriminatorMapping.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EmbeddableMapping extends ModelPart, ModelPartContainer {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
|
|
||||||
== Relationship with legacy "persister walking" SPI
|
== Relationship with legacy "persister walking" SPI
|
||||||
|
|
||||||
`org.hibernate.metamodel.model.mapping` contract corollaries in `org.hibernate.persister.walking`:
|
`org.hibernate.metamodel.model.mapping` contract corollaries in `org.hibernate.persister.walking`:
|
||||||
|
|
|
@ -132,10 +132,10 @@ public class DefaultLoadEventListener implements LoadEventListener {
|
||||||
|
|
||||||
if ( cidMapping.getAttributeCount() == 1 ) {
|
if ( cidMapping.getAttributeCount() == 1 ) {
|
||||||
final AttributeMapping singleIdAttribute = cidMapping.getAttributes().iterator().next();
|
final AttributeMapping singleIdAttribute = cidMapping.getAttributes().iterator().next();
|
||||||
if ( singleIdAttribute.getMappedTypeDescriptor() instanceof EntityMappingType ) {
|
if ( singleIdAttribute.getMappedType() instanceof EntityMappingType ) {
|
||||||
final EntityMappingType dependentIdTargetMapping = (EntityMappingType) singleIdAttribute.getMappedTypeDescriptor();
|
final EntityMappingType dependentIdTargetMapping = (EntityMappingType) singleIdAttribute.getMappedType();
|
||||||
final EntityIdentifierMapping dependentIdTargetIdMapping = dependentIdTargetMapping.getIdentifierMapping();
|
final EntityIdentifierMapping dependentIdTargetIdMapping = dependentIdTargetMapping.getIdentifierMapping();
|
||||||
final JavaTypeDescriptor dependentParentIdJtd = dependentIdTargetIdMapping.getMappedTypeDescriptor().getMappedJavaTypeDescriptor();
|
final JavaTypeDescriptor dependentParentIdJtd = dependentIdTargetIdMapping.getMappedType().getMappedJavaTypeDescriptor();
|
||||||
if ( dependentParentIdJtd.getJavaType().isInstance( event.getEntityId() ) ) {
|
if ( dependentParentIdJtd.getJavaType().isInstance( event.getEntityId() ) ) {
|
||||||
// yep that's what we have...
|
// yep that's what we have...
|
||||||
loadByDerivedIdentitySimplePkValue(
|
loadByDerivedIdentitySimplePkValue(
|
||||||
|
|
|
@ -34,12 +34,10 @@ import org.hibernate.loader.ast.spi.Loadable;
|
||||||
import org.hibernate.loader.ast.spi.Loader;
|
import org.hibernate.loader.ast.spi.Loader;
|
||||||
import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
||||||
import org.hibernate.metamodel.mapping.CollectionPart;
|
import org.hibernate.metamodel.mapping.CollectionPart;
|
||||||
import org.hibernate.metamodel.mapping.EmbeddableValuedModelPart;
|
|
||||||
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
||||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||||
import org.hibernate.metamodel.mapping.EntityValuedModelPart;
|
import org.hibernate.metamodel.mapping.EntityValuedModelPart;
|
||||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||||
import org.hibernate.metamodel.mapping.JdbcMapping;
|
|
||||||
import org.hibernate.metamodel.mapping.ModelPart;
|
import org.hibernate.metamodel.mapping.ModelPart;
|
||||||
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
|
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
|
||||||
import org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping;
|
import org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping;
|
||||||
|
@ -654,7 +652,7 @@ public class LoaderSelectBuilder {
|
||||||
|
|
||||||
if ( fetch.getTiming() == FetchTiming.IMMEDIATE && fetchable instanceof PluralAttributeMapping ) {
|
if ( fetch.getTiming() == FetchTiming.IMMEDIATE && fetchable instanceof PluralAttributeMapping ) {
|
||||||
final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) fetchable;
|
final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) fetchable;
|
||||||
if ( pluralAttributeMapping.getMappedTypeDescriptor()
|
if ( pluralAttributeMapping.getMappedType()
|
||||||
.getCollectionSemantics() instanceof BagSemantics ) {
|
.getCollectionSemantics() instanceof BagSemantics ) {
|
||||||
bagRoles.add( fetchable.getNavigableRole().getNavigableName() );
|
bagRoles.add( fetchable.getNavigableRole().getNavigableName() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ public abstract class AbstractCompositeIdentifierMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmbeddableMappingType getMappedTypeDescriptor() {
|
public EmbeddableMappingType getMappedType() {
|
||||||
return embeddableDescriptor;
|
return embeddableDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public interface PluralAttributeMapping
|
||||||
CollectionPart getIndexDescriptor();
|
CollectionPart getIndexDescriptor();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
CollectionMappingType getMappedTypeDescriptor();
|
CollectionMappingType getMappedType();
|
||||||
|
|
||||||
interface IndexMetadata {
|
interface IndexMetadata {
|
||||||
CollectionPart getIndexDescriptor();
|
CollectionPart getIndexDescriptor();
|
||||||
|
|
|
@ -22,7 +22,7 @@ public interface ValueMapping extends MappingModelExpressable {
|
||||||
/**
|
/**
|
||||||
* Descriptor for the type of this mapping
|
* Descriptor for the type of this mapping
|
||||||
*/
|
*/
|
||||||
MappingType getMappedTypeDescriptor();
|
MappingType getMappedType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Treat operation. Asks the ValueMapping to treat itself as the
|
* Treat operation. Asks the ValueMapping to treat itself as the
|
||||||
|
|
|
@ -38,13 +38,13 @@ public abstract class AbstractAttributeMapping implements AttributeMapping {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getPartMappingType() {
|
public MappingType getPartMappingType() {
|
||||||
return getMappedTypeDescriptor();
|
return getMappedType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
||||||
return getMappedTypeDescriptor().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setForeignKeyDescriptor(ForeignKeyDescriptor foreignKeyDescriptor){
|
void setForeignKeyDescriptor(ForeignKeyDescriptor foreignKeyDescriptor){
|
||||||
|
|
|
@ -139,11 +139,11 @@ public abstract class AbstractEntityDiscriminatorMapping implements EntityDiscri
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
||||||
return getMappedTypeDescriptor().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return mappingType;
|
return mappingType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return getJdbcMapping()::getJavaTypeDescriptor;
|
return getJdbcMapping()::getJavaTypeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
||||||
return getMappedTypeDescriptor().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -217,7 +217,7 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
|
||||||
return new BasicResult(
|
return new BasicResult(
|
||||||
sqlSelection.getValuesArrayPosition(),
|
sqlSelection.getValuesArrayPosition(),
|
||||||
resultVariable,
|
resultVariable,
|
||||||
entityPersister.getIdentifierMapping().getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
entityPersister.getIdentifierMapping().getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
navigablePath
|
navigablePath
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class BasicValuedCollectionPart
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return this::getJavaTypeDescriptor;
|
return this::getJavaTypeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,9 @@ package org.hibernate.metamodel.mapping.internal;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.MappingException;
|
|
||||||
import org.hibernate.engine.FetchStrategy;
|
import org.hibernate.engine.FetchStrategy;
|
||||||
import org.hibernate.engine.FetchTiming;
|
import org.hibernate.engine.FetchTiming;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
|
||||||
import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
||||||
import org.hibernate.metamodel.mapping.ColumnConsumer;
|
import org.hibernate.metamodel.mapping.ColumnConsumer;
|
||||||
import org.hibernate.metamodel.mapping.ConvertibleModelPart;
|
import org.hibernate.metamodel.mapping.ConvertibleModelPart;
|
||||||
|
@ -26,7 +24,6 @@ import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.metamodel.model.domain.NavigableRole;
|
import org.hibernate.metamodel.model.domain.NavigableRole;
|
||||||
import org.hibernate.property.access.spi.PropertyAccess;
|
import org.hibernate.property.access.spi.PropertyAccess;
|
||||||
import org.hibernate.query.NavigablePath;
|
import org.hibernate.query.NavigablePath;
|
||||||
import org.hibernate.sql.Template;
|
|
||||||
import org.hibernate.sql.ast.Clause;
|
import org.hibernate.sql.ast.Clause;
|
||||||
import org.hibernate.sql.ast.spi.SqlAstCreationState;
|
import org.hibernate.sql.ast.spi.SqlAstCreationState;
|
||||||
import org.hibernate.sql.ast.spi.SqlExpressionResolver;
|
import org.hibernate.sql.ast.spi.SqlExpressionResolver;
|
||||||
|
@ -96,7 +93,7 @@ public class BasicValuedSingularAttributeMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return getJdbcMapping();
|
return getJdbcMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +139,7 @@ public class BasicValuedSingularAttributeMapping
|
||||||
return new BasicResult(
|
return new BasicResult(
|
||||||
sqlSelection.getValuesArrayPosition(),
|
sqlSelection.getValuesArrayPosition(),
|
||||||
resultVariable,
|
resultVariable,
|
||||||
getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
valueConverter,
|
valueConverter,
|
||||||
navigablePath
|
navigablePath
|
||||||
);
|
);
|
||||||
|
@ -169,7 +166,7 @@ public class BasicValuedSingularAttributeMapping
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
|
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
valueConverter == null ? getMappedTypeDescriptor().getMappedJavaTypeDescriptor() : valueConverter.getRelationalJavaDescriptor(),
|
valueConverter == null ? getMappedType().getMappedJavaTypeDescriptor() : valueConverter.getRelationalJavaDescriptor(),
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -198,7 +195,7 @@ public class BasicValuedSingularAttributeMapping
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
|
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
valueConverter == null ? getMappedTypeDescriptor().getMappedJavaTypeDescriptor() : valueConverter.getRelationalJavaDescriptor(),
|
valueConverter == null ? getMappedType().getMappedJavaTypeDescriptor() : valueConverter.getRelationalJavaDescriptor(),
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,13 +82,13 @@ public class CollectionIdentifierDescriptorImpl implements CollectionIdentifierD
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
public JavaTypeDescriptor getJavaTypeDescriptor() {
|
||||||
return getMappedTypeDescriptor().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class EmbeddedAttributeMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmbeddableMappingType getMappedTypeDescriptor() {
|
public EmbeddableMappingType getMappedType() {
|
||||||
return getEmbeddableTypeDescriptor();
|
return getEmbeddableTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,14 +247,14 @@ public class EmbeddedAttributeMapping
|
||||||
public ModelPart findSubPart(
|
public ModelPart findSubPart(
|
||||||
String name,
|
String name,
|
||||||
EntityMappingType treatTargetType) {
|
EntityMappingType treatTargetType) {
|
||||||
return getMappedTypeDescriptor().findSubPart( name, treatTargetType );
|
return getMappedType().findSubPart( name, treatTargetType );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitSubParts(
|
public void visitSubParts(
|
||||||
Consumer<ModelPart> consumer,
|
Consumer<ModelPart> consumer,
|
||||||
EntityMappingType treatTargetType) {
|
EntityMappingType treatTargetType) {
|
||||||
getMappedTypeDescriptor().visitSubParts( consumer, treatTargetType );
|
getMappedType().visitSubParts( consumer, treatTargetType );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class EntityDiscriminatorMappingImpl extends AbstractEntityDiscriminatorM
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
|
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class EntityVersionMappingImpl implements EntityVersionMapping, FetchOpti
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return versionBasicType;
|
return versionBasicType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class JoinedSubclassDiscriminatorMappingImpl extends AbstractEntityDiscri
|
||||||
columnReference ->
|
columnReference ->
|
||||||
expressionResolver.resolveSqlSelection(
|
expressionResolver.resolveSqlSelection(
|
||||||
columnReference,
|
columnReference,
|
||||||
getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
creationState.getSqlAstCreationState()
|
creationState.getSqlAstCreationState()
|
||||||
.getCreationContext()
|
.getCreationContext()
|
||||||
.getDomainModel()
|
.getDomainModel()
|
||||||
|
@ -64,7 +64,7 @@ public class JoinedSubclassDiscriminatorMappingImpl extends AbstractEntityDiscri
|
||||||
getMappedColumnExpression(),
|
getMappedColumnExpression(),
|
||||||
sqlAstProcessingState -> caseSearchedExpression
|
sqlAstProcessingState -> caseSearchedExpression
|
||||||
),
|
),
|
||||||
getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
creationState.getSqlAstCreationState().getCreationContext().getDomainModel().getTypeConfiguration()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,7 +357,7 @@ public class PluralAttributeMappingImpl extends AbstractAttributeMapping
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public CollectionMappingType getMappedTypeDescriptor() {
|
public CollectionMappingType getMappedType() {
|
||||||
return collectionMappingType;
|
return collectionMappingType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MappingType getMappedTypeDescriptor() {
|
public MappingType getMappedType() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ public class ToOneAttributeMapping extends AbstractSingularAttributeMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityMappingType getMappedTypeDescriptor() {
|
public EntityMappingType getMappedType() {
|
||||||
return getEntityMappingType();
|
return getEntityMappingType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class CompleteResultBuilderBasicValuedStandard implements CompleteResultB
|
||||||
sessionFactory.getTypeConfiguration()
|
sessionFactory.getTypeConfiguration()
|
||||||
);
|
);
|
||||||
|
|
||||||
return new BasicResult<>( valuesArrayPosition, columnName, basicType.getMappedTypeDescriptor().getMappedJavaTypeDescriptor() );
|
return new BasicResult<>( valuesArrayPosition, columnName, basicType.getMappedType().getMappedJavaTypeDescriptor() );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.hibernate.HibernateException;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.LockOptions;
|
import org.hibernate.LockOptions;
|
||||||
import org.hibernate.NotYetImplementedFor6Exception;
|
import org.hibernate.NotYetImplementedFor6Exception;
|
||||||
import org.hibernate.collection.spi.BagSemantics;
|
|
||||||
import org.hibernate.engine.FetchTiming;
|
import org.hibernate.engine.FetchTiming;
|
||||||
import org.hibernate.engine.profile.FetchProfile;
|
import org.hibernate.engine.profile.FetchProfile;
|
||||||
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
||||||
|
@ -296,7 +295,7 @@ public class StandardSqmSelectTranslator
|
||||||
if ( fetch != null ) {
|
if ( fetch != null ) {
|
||||||
if ( fetch.getTiming() == FetchTiming.IMMEDIATE && fetchable instanceof PluralAttributeMapping ) {
|
if ( fetch.getTiming() == FetchTiming.IMMEDIATE && fetchable instanceof PluralAttributeMapping ) {
|
||||||
final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) fetchable;
|
final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) fetchable;
|
||||||
final CollectionClassification collectionClassification = pluralAttributeMapping.getMappedTypeDescriptor()
|
final CollectionClassification collectionClassification = pluralAttributeMapping.getMappedType()
|
||||||
.getCollectionSemantics()
|
.getCollectionSemantics()
|
||||||
.getCollectionClassification();
|
.getCollectionClassification();
|
||||||
if ( collectionClassification == CollectionClassification.BAG ) {
|
if ( collectionClassification == CollectionClassification.BAG ) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ public abstract class AbstractLiteral<T>
|
||||||
final SqlExpressionResolver sqlExpressionResolver = creationState.getSqlAstCreationState().getSqlExpressionResolver();
|
final SqlExpressionResolver sqlExpressionResolver = creationState.getSqlAstCreationState().getSqlExpressionResolver();
|
||||||
final SqlSelection sqlSelection = sqlExpressionResolver.resolveSqlSelection(
|
final SqlSelection sqlSelection = sqlExpressionResolver.resolveSqlSelection(
|
||||||
this,
|
this,
|
||||||
type.getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
type.getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
creationState.getSqlAstCreationState()
|
creationState.getSqlAstCreationState()
|
||||||
.getCreationContext()
|
.getCreationContext()
|
||||||
.getSessionFactory()
|
.getSessionFactory()
|
||||||
|
@ -76,7 +76,7 @@ public abstract class AbstractLiteral<T>
|
||||||
return new BasicResult<>(
|
return new BasicResult<>(
|
||||||
sqlSelection.getValuesArrayPosition(),
|
sqlSelection.getValuesArrayPosition(),
|
||||||
resultVariable,
|
resultVariable,
|
||||||
type.getMappedTypeDescriptor().getMappedJavaTypeDescriptor()
|
type.getMappedType().getMappedJavaTypeDescriptor()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class QueryLiteral<T> implements Literal, DomainResultProducer<T> {
|
||||||
final SqlExpressionResolver sqlExpressionResolver = creationState.getSqlAstCreationState().getSqlExpressionResolver();
|
final SqlExpressionResolver sqlExpressionResolver = creationState.getSqlAstCreationState().getSqlExpressionResolver();
|
||||||
final SqlSelection sqlSelection = sqlExpressionResolver.resolveSqlSelection(
|
final SqlSelection sqlSelection = sqlExpressionResolver.resolveSqlSelection(
|
||||||
this,
|
this,
|
||||||
type.getMappedTypeDescriptor().getMappedJavaTypeDescriptor(),
|
type.getMappedType().getMappedJavaTypeDescriptor(),
|
||||||
creationState.getSqlAstCreationState()
|
creationState.getSqlAstCreationState()
|
||||||
.getCreationContext()
|
.getCreationContext()
|
||||||
.getSessionFactory()
|
.getSessionFactory()
|
||||||
|
@ -78,7 +78,7 @@ public class QueryLiteral<T> implements Literal, DomainResultProducer<T> {
|
||||||
return new BasicResult<>(
|
return new BasicResult<>(
|
||||||
sqlSelection.getValuesArrayPosition(),
|
sqlSelection.getValuesArrayPosition(),
|
||||||
resultVariable,
|
resultVariable,
|
||||||
type.getMappedTypeDescriptor().getMappedJavaTypeDescriptor()
|
type.getMappedType().getMappedJavaTypeDescriptor()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
||||||
|
|
||||||
final DomainResultAssembler stateAssembler;
|
final DomainResultAssembler stateAssembler;
|
||||||
if ( fetch == null ) {
|
if ( fetch == null ) {
|
||||||
stateAssembler = new NullValueAssembler( attributeMapping.getMappedTypeDescriptor().getMappedJavaTypeDescriptor() );
|
stateAssembler = new NullValueAssembler( attributeMapping.getMappedType().getMappedJavaTypeDescriptor() );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
stateAssembler = fetch.createAssembler( this, creationState );
|
stateAssembler = fetch.createAssembler( this, creationState );
|
||||||
|
|
|
@ -189,7 +189,7 @@ public class CircularBiDirectionalFetchImpl implements BiDirectionalFetch, Assoc
|
||||||
final CollectionKey collectionKey = circ.resolveCollectionKey( rowProcessingState );
|
final CollectionKey collectionKey = circ.resolveCollectionKey( rowProcessingState );
|
||||||
final EntityKey entityKey = new EntityKey(
|
final EntityKey entityKey = new EntityKey(
|
||||||
collectionKey.getKey(),
|
collectionKey.getKey(),
|
||||||
(EntityPersister) ( (AttributeMapping) fetchable ).getMappedTypeDescriptor()
|
(EntityPersister) ( (AttributeMapping) fetchable ).getMappedType()
|
||||||
);
|
);
|
||||||
|
|
||||||
final SharedSessionContractImplementor session = rowProcessingState.getJdbcValuesSourceProcessingState()
|
final SharedSessionContractImplementor session = rowProcessingState.getJdbcValuesSourceProcessingState()
|
||||||
|
|
|
@ -33,7 +33,7 @@ public interface BasicType<T> extends Type, BasicDomainType<T>, MappingType, Bas
|
||||||
String[] getRegistrationKeys();
|
String[] getRegistrationKeys();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default MappingType getMappedTypeDescriptor() {
|
default MappingType getMappedType() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class SmokeTests {
|
||||||
|
|
||||||
final EntityIdentifierMapping identifierMapping = entityDescriptor.getIdentifierMapping();
|
final EntityIdentifierMapping identifierMapping = entityDescriptor.getIdentifierMapping();
|
||||||
assertThat(
|
assertThat(
|
||||||
identifierMapping.getMappedTypeDescriptor().getMappedJavaTypeDescriptor().getJavaType(),
|
identifierMapping.getMappedType().getMappedJavaTypeDescriptor().getJavaType(),
|
||||||
sameInstance( Integer.class )
|
sameInstance( Integer.class )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ public class SmokeTests {
|
||||||
assertThat( part, instanceOf( ToOneAttributeMapping.class ) );
|
assertThat( part, instanceOf( ToOneAttributeMapping.class ) );
|
||||||
final ToOneAttributeMapping attrMapping = (ToOneAttributeMapping) part;
|
final ToOneAttributeMapping attrMapping = (ToOneAttributeMapping) part;
|
||||||
assertThat( attrMapping.getAttributeName(), is( "simpleEntity" ) );
|
assertThat( attrMapping.getAttributeName(), is( "simpleEntity" ) );
|
||||||
assertThat( attrMapping.getMappedTypeDescriptor(), is( simpleEntityDescriptor ) );
|
assertThat( attrMapping.getMappedType(), is( simpleEntityDescriptor ) );
|
||||||
assertThat(
|
assertThat(
|
||||||
attrMapping.getJavaTypeDescriptor(),
|
attrMapping.getJavaTypeDescriptor(),
|
||||||
is( simpleEntityDescriptor.getJavaTypeDescriptor() )
|
is( simpleEntityDescriptor.getJavaTypeDescriptor() )
|
||||||
|
|
Loading…
Reference in New Issue