Search in sources :

Example 1 with AttributeMetadata

use of org.hibernate.metamodel.mapping.AttributeMetadata in project hibernate-orm by hibernate.

the class AbstractEntityPersister method setPropertyValue.

@Override
public void setPropertyValue(Object object, String propertyName, Object value) {
    final AttributeMapping attributeMapping = (AttributeMapping) findSubPart(propertyName, this);
    final AttributeMetadata attributeMetadata = attributeMapping.getAttributeMetadataAccess().resolveAttributeMetadata(this);
    attributeMetadata.getPropertyAccess().getSetter().set(object, value);
}
Also used : AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) DiscriminatedAssociationAttributeMapping(org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationAttributeMapping) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) SingularAttributeMapping(org.hibernate.metamodel.mapping.SingularAttributeMapping) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping)

Example 2 with AttributeMetadata

use of org.hibernate.metamodel.mapping.AttributeMetadata in project hibernate-orm by hibernate.

the class AbstractCompositeIdAndNaturalIdTest method testNaturalIdNullability.

@Test
@TestForIssue(jiraKey = "HHH-10360")
public void testNaturalIdNullability(SessionFactoryScope scope) {
    final EntityMappingType accountMapping = scope.getSessionFactory().getRuntimeMetamodels().getEntityMappingType(Account.class);
    final SingularAttributeMapping shortCodeMapping = ((SimpleNaturalIdMapping) accountMapping.getNaturalIdMapping()).getAttribute();
    final AttributeMetadata shortCodeMetadata = shortCodeMapping.getAttributeMetadataAccess().resolveAttributeMetadata(null);
    assertThat(shortCodeMetadata.isNullable(), is(false));
    final EntityPersister rootEntityPersister = accountMapping.getRootEntityDescriptor().getEntityPersister();
    final int shortCodeLegacyPropertyIndex = rootEntityPersister.getEntityMetamodel().getPropertyIndex("shortCode");
    assertThat(shortCodeLegacyPropertyIndex, is(0));
    assertThat(rootEntityPersister.getPropertyNullability()[shortCodeLegacyPropertyIndex], is(false));
}
Also used : EntityPersister(org.hibernate.persister.entity.EntityPersister) SimpleNaturalIdMapping(org.hibernate.metamodel.mapping.internal.SimpleNaturalIdMapping) AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) SingularAttributeMapping(org.hibernate.metamodel.mapping.SingularAttributeMapping) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) Test(org.junit.jupiter.api.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Example 3 with AttributeMetadata

use of org.hibernate.metamodel.mapping.AttributeMetadata in project hibernate-orm by hibernate.

the class ImmutableManyToOneNaturalIdAnnotationTest method testNaturalIdNullability.

@Test
@TestForIssue(jiraKey = "HHH-10360")
public void testNaturalIdNullability(SessionFactoryScope scope) {
    // nullability is not specified for either properties making up
    // the natural ID, so they should be nullable by annotation-specific default
    final RuntimeMetamodels runtimeMetamodels = scope.getSessionFactory().getRuntimeMetamodels();
    final EntityMappingType childMapping = runtimeMetamodels.getEntityMappingType(Child.class.getName());
    final EntityPersister persister = childMapping.getEntityPersister();
    final EntityMetamodel entityMetamodel = persister.getEntityMetamodel();
    final int nameIndex = entityMetamodel.getPropertyIndex("name");
    final int parentIndex = entityMetamodel.getPropertyIndex("parent");
    // checking alphabetic sort in relation to EntityPersister/EntityMetamodel
    assertThat(nameIndex, lessThan(parentIndex));
    assertFalse(persister.getPropertyUpdateability()[nameIndex]);
    assertFalse(persister.getPropertyUpdateability()[parentIndex]);
    assertTrue(persister.getPropertyNullability()[nameIndex]);
    assertTrue(persister.getPropertyNullability()[parentIndex]);
    final NaturalIdMapping naturalIdMapping = childMapping.getNaturalIdMapping();
    assertNotNull(naturalIdMapping);
    assertThat(naturalIdMapping.getNaturalIdAttributes().size(), is(2));
    // access by list-index should again be alphabetically sorted
    final SingularAttributeMapping first = naturalIdMapping.getNaturalIdAttributes().get(0);
    assertThat(first.getAttributeName(), is("name"));
    final AttributeMetadata firstMetadata = first.getAttributeMetadataAccess().resolveAttributeMetadata(null);
    assertFalse(firstMetadata.getMutabilityPlan().isMutable());
    final SingularAttributeMapping second = naturalIdMapping.getNaturalIdAttributes().get(1);
    assertThat(second.getAttributeName(), is("parent"));
    final AttributeMetadata secondMetadata = second.getAttributeMetadataAccess().resolveAttributeMetadata(null);
    assertFalse(secondMetadata.getMutabilityPlan().isMutable());
}
Also used : EntityPersister(org.hibernate.persister.entity.EntityPersister) AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) NaturalIdMapping(org.hibernate.metamodel.mapping.NaturalIdMapping) RuntimeMetamodels(org.hibernate.metamodel.RuntimeMetamodels) SingularAttributeMapping(org.hibernate.metamodel.mapping.SingularAttributeMapping) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) EntityMetamodel(org.hibernate.tuple.entity.EntityMetamodel) Test(org.junit.jupiter.api.Test) TestForIssue(org.hibernate.testing.TestForIssue)

Example 4 with AttributeMetadata

use of org.hibernate.metamodel.mapping.AttributeMetadata in project hibernate-orm by hibernate.

the class MappingModelCreationHelper method buildBasicAttributeMapping.

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Non-identifier attributes
@SuppressWarnings("rawtypes")
public static BasicAttributeMapping buildBasicAttributeMapping(String attrName, NavigableRole navigableRole, int stateArrayPosition, Property bootProperty, ManagedMappingType declaringType, BasicType attrType, String tableExpression, String attrColumnName, boolean isAttrFormula, String readExpr, String writeExpr, String columnDefinition, Long length, Integer precision, Integer scale, PropertyAccess propertyAccess, CascadeStyle cascadeStyle, MappingModelCreationProcess creationProcess) {
    final Value value = bootProperty.getValue();
    final BasicValue.Resolution<?> resolution = ((Resolvable) value).resolve();
    final BasicValueConverter<?, ?> valueConverter = resolution.getValueConverter();
    final AttributeMetadataAccess attributeMetadataAccess = entityMappingType -> new AttributeMetadata() {

        private final MutabilityPlan mutabilityPlan = resolution.getMutabilityPlan();

        private final boolean nullable = value.isNullable();

        private final boolean insertable = bootProperty.isInsertable();

        private final boolean updateable = bootProperty.isUpdateable();

        private final boolean includeInOptimisticLocking = bootProperty.isOptimisticLocked();

        @Override
        public PropertyAccess getPropertyAccess() {
            return propertyAccess;
        }

        @Override
        public MutabilityPlan getMutabilityPlan() {
            return mutabilityPlan;
        }

        @Override
        public boolean isNullable() {
            return nullable;
        }

        @Override
        public boolean isInsertable() {
            return insertable;
        }

        @Override
        public boolean isUpdatable() {
            return updateable;
        }

        @Override
        public boolean isIncludedInDirtyChecking() {
            // todo (6.0) : do not believe this is correct
            return updateable;
        }

        @Override
        public boolean isIncludedInOptimisticLocking() {
            return includeInOptimisticLocking;
        }

        @Override
        public CascadeStyle getCascadeStyle() {
            return cascadeStyle;
        }
    };
    final FetchTiming fetchTiming;
    final FetchStyle fetchStyle;
    if (declaringType instanceof EmbeddableMappingType) {
        if (bootProperty.isLazy()) {
            LOGGER.debugf("Attribute was declared lazy, but is part of an embeddable - `%s#%s` - LAZY will be ignored", declaringType.getNavigableRole().getFullPath(), bootProperty.getName());
        }
        fetchTiming = FetchTiming.IMMEDIATE;
        fetchStyle = FetchStyle.JOIN;
    } else {
        fetchTiming = bootProperty.isLazy() ? FetchTiming.DELAYED : FetchTiming.IMMEDIATE;
        fetchStyle = bootProperty.isLazy() ? FetchStyle.SELECT : FetchStyle.JOIN;
    }
    final ValueGeneration valueGeneration = bootProperty.getValueGenerationStrategy();
    if (valueConverter != null) {
        // we want to "decompose" the "type" into its various pieces as expected by the mapping
        assert valueConverter.getRelationalJavaType() == resolution.getRelationalJavaType();
        final BasicType<?> mappingBasicType = creationProcess.getCreationContext().getDomainModel().getTypeConfiguration().getBasicTypeRegistry().resolve(valueConverter.getRelationalJavaType(), resolution.getJdbcType());
        return new BasicAttributeMapping(attrName, navigableRole, stateArrayPosition, attributeMetadataAccess, fetchTiming, fetchStyle, tableExpression, attrColumnName, isAttrFormula, null, null, columnDefinition, length, precision, scale, valueConverter, mappingBasicType.getJdbcMapping(), declaringType, propertyAccess, valueGeneration);
    } else {
        return new BasicAttributeMapping(attrName, navigableRole, stateArrayPosition, attributeMetadataAccess, fetchTiming, fetchStyle, tableExpression, attrColumnName, isAttrFormula, readExpr, writeExpr, columnDefinition, length, precision, scale, null, attrType, declaringType, propertyAccess, valueGeneration);
    }
}
Also used : SortedSet(java.util.SortedSet) EntityPersister(org.hibernate.persister.entity.EntityPersister) Property(org.hibernate.mapping.Property) CompositeIdentifierMapping(org.hibernate.metamodel.mapping.CompositeIdentifierMapping) BasicType(org.hibernate.type.BasicType) CollectionIdentifierDescriptor(org.hibernate.metamodel.mapping.CollectionIdentifierDescriptor) Any(org.hibernate.mapping.Any) Joinable(org.hibernate.persister.entity.Joinable) PropertyAccess(org.hibernate.property.access.spi.PropertyAccess) ForeignKeyDirection(org.hibernate.type.ForeignKeyDirection) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) ToOne(org.hibernate.mapping.ToOne) NotYetImplementedFor6Exception(org.hibernate.NotYetImplementedFor6Exception) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ImmutableMutabilityPlan(org.hibernate.type.descriptor.java.ImmutableMutabilityPlan) ForeignKeyDescriptor(org.hibernate.metamodel.mapping.ForeignKeyDescriptor) PersistentClass(org.hibernate.mapping.PersistentClass) TableGroupProducer(org.hibernate.sql.ast.tree.from.TableGroupProducer) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) CollectionPart(org.hibernate.metamodel.mapping.CollectionPart) StandardArraySemantics(org.hibernate.collection.internal.StandardArraySemantics) AttributeMetadataAccess(org.hibernate.metamodel.mapping.AttributeMetadataAccess) TypeConfiguration(org.hibernate.type.spi.TypeConfiguration) SimpleValue(org.hibernate.mapping.SimpleValue) OneToOne(org.hibernate.mapping.OneToOne) VirtualModelPart(org.hibernate.metamodel.mapping.VirtualModelPart) StringHelper(org.hibernate.internal.util.StringHelper) Value(org.hibernate.mapping.Value) ChainedPropertyAccessImpl(org.hibernate.property.access.internal.ChainedPropertyAccessImpl) Collection(org.hibernate.mapping.Collection) Serializable(java.io.Serializable) MappingMetamodel(org.hibernate.metamodel.MappingMetamodel) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) NavigableRole(org.hibernate.metamodel.model.domain.NavigableRole) List(java.util.List) OneToMany(org.hibernate.mapping.OneToMany) Dialect(org.hibernate.dialect.Dialect) CascadeStyle(org.hibernate.engine.spi.CascadeStyle) RuntimeModelCreationContext(org.hibernate.metamodel.spi.RuntimeModelCreationContext) MappingException(org.hibernate.MappingException) FetchMode(org.hibernate.FetchMode) SharedSessionContract(org.hibernate.SharedSessionContract) BasicValue(org.hibernate.mapping.BasicValue) CollectionPersister(org.hibernate.persister.collection.CollectionPersister) StandardIdentifierBagSemantics(org.hibernate.collection.internal.StandardIdentifierBagSemantics) CollectionMappingType(org.hibernate.metamodel.mapping.CollectionMappingType) SortedMap(java.util.SortedMap) BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) MutabilityPlan(org.hibernate.type.descriptor.java.MutabilityPlan) SqlStringGenerationContext(org.hibernate.boot.model.relational.SqlStringGenerationContext) SelectableMappings(org.hibernate.metamodel.mapping.SelectableMappings) JdbcMapping(org.hibernate.metamodel.mapping.JdbcMapping) JavaType(org.hibernate.type.descriptor.java.JavaType) StandardBagSemantics(org.hibernate.collection.internal.StandardBagSemantics) SqlAliasStemHelper(org.hibernate.sql.ast.spi.SqlAliasStemHelper) EntityType(org.hibernate.type.EntityType) IndexedCollection(org.hibernate.mapping.IndexedCollection) ValueGeneration(org.hibernate.tuple.ValueGeneration) ModelPart(org.hibernate.metamodel.mapping.ModelPart) ComponentType(org.hibernate.type.ComponentType) CollectionSemantics(org.hibernate.collection.spi.CollectionSemantics) CompositeType(org.hibernate.type.CompositeType) ManagedMappingType(org.hibernate.metamodel.mapping.ManagedMappingType) SQLLoadableCollection(org.hibernate.persister.collection.SQLLoadableCollection) AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) JavaTypeRegistry(org.hibernate.type.descriptor.java.spi.JavaTypeRegistry) FetchTiming(org.hibernate.engine.FetchTiming) ManyToOne(org.hibernate.mapping.ManyToOne) SortableValue(org.hibernate.mapping.SortableValue) Iterator(java.util.Iterator) EmbeddableMappingType(org.hibernate.metamodel.mapping.EmbeddableMappingType) ModelPartContainer(org.hibernate.metamodel.mapping.ModelPartContainer) Table(org.hibernate.mapping.Table) PropertyBasedMapping(org.hibernate.metamodel.mapping.PropertyBasedMapping) QueryableCollection(org.hibernate.persister.collection.QueryableCollection) FetchStyle(org.hibernate.engine.FetchStyle) Component(org.hibernate.mapping.Component) CollectionClassification(org.hibernate.metamodel.CollectionClassification) SelectableMapping(org.hibernate.metamodel.mapping.SelectableMapping) NotFoundAction(org.hibernate.annotations.NotFoundAction) StandardListSemantics(org.hibernate.collection.internal.StandardListSemantics) Selectable(org.hibernate.mapping.Selectable) NonAggregatedIdentifierMapping(org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping) Resolvable(org.hibernate.mapping.Resolvable) EmbeddableValuedModelPart(org.hibernate.metamodel.mapping.EmbeddableValuedModelPart) BasicValueConverter(org.hibernate.metamodel.model.convert.spi.BasicValueConverter) Map(org.hibernate.mapping.Map) AssociationType(org.hibernate.type.AssociationType) Type(org.hibernate.type.Type) LOGGER(org.hibernate.metamodel.mapping.MappingModelCreationLogger.LOGGER) KeyValue(org.hibernate.mapping.KeyValue) Resolvable(org.hibernate.mapping.Resolvable) EmbeddableMappingType(org.hibernate.metamodel.mapping.EmbeddableMappingType) BasicValue(org.hibernate.mapping.BasicValue) FetchStyle(org.hibernate.engine.FetchStyle) ValueGeneration(org.hibernate.tuple.ValueGeneration) AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) FetchTiming(org.hibernate.engine.FetchTiming) SimpleValue(org.hibernate.mapping.SimpleValue) Value(org.hibernate.mapping.Value) BasicValue(org.hibernate.mapping.BasicValue) SortableValue(org.hibernate.mapping.SortableValue) KeyValue(org.hibernate.mapping.KeyValue) AttributeMetadataAccess(org.hibernate.metamodel.mapping.AttributeMetadataAccess) ImmutableMutabilityPlan(org.hibernate.type.descriptor.java.ImmutableMutabilityPlan) MutabilityPlan(org.hibernate.type.descriptor.java.MutabilityPlan)

Example 5 with AttributeMetadata

use of org.hibernate.metamodel.mapping.AttributeMetadata in project hibernate-orm by hibernate.

the class AbstractEntityPersister method generateNonIdAttributeMapping.

private AttributeMapping generateNonIdAttributeMapping(NonIdentifierAttribute tupleAttrDefinition, Property bootProperty, int stateArrayPosition, MappingModelCreationProcess creationProcess) {
    final SessionFactoryImplementor sessionFactory = creationProcess.getCreationContext().getSessionFactory();
    final JdbcServices jdbcServices = sessionFactory.getJdbcServices();
    final JdbcEnvironment jdbcEnvironment = jdbcServices.getJdbcEnvironment();
    final Dialect dialect = jdbcEnvironment.getDialect();
    final String attrName = tupleAttrDefinition.getName();
    final Type attrType = tupleAttrDefinition.getType();
    final int propertyIndex = getPropertyIndex(bootProperty.getName());
    final String tableExpression = getTableName(getPropertyTableNumbers()[propertyIndex]);
    final String[] attrColumnNames = getPropertyColumnNames(propertyIndex);
    final PropertyAccess propertyAccess = getRepresentationStrategy().resolvePropertyAccess(bootProperty);
    if (propertyIndex == getVersionProperty()) {
        Column column = bootProperty.getValue().getColumns().get(0);
        return MappingModelCreationHelper.buildBasicAttributeMapping(attrName, getNavigableRole().append(bootProperty.getName()), stateArrayPosition, bootProperty, this, (BasicType<?>) attrType, tableExpression, attrColumnNames[0], false, null, null, column.getSqlType(), column.getLength(), column.getPrecision(), column.getScale(), propertyAccess, tupleAttrDefinition.getCascadeStyle(), creationProcess);
    }
    if (attrType instanceof BasicType) {
        final Value bootValue = bootProperty.getValue();
        final String attrColumnExpression;
        final boolean isAttrColumnExpressionFormula;
        final String customReadExpr;
        final String customWriteExpr;
        final String columnDefinition;
        final Long length;
        final Integer precision;
        final Integer scale;
        if (bootValue instanceof DependantValue) {
            attrColumnExpression = attrColumnNames[0];
            isAttrColumnExpressionFormula = false;
            customReadExpr = null;
            customWriteExpr = null;
            Column column = bootValue.getColumns().get(0);
            columnDefinition = column.getSqlType();
            length = column.getLength();
            precision = column.getPrecision();
            scale = column.getScale();
        } else {
            final BasicValue basicBootValue = (BasicValue) bootValue;
            if (attrColumnNames[0] != null) {
                attrColumnExpression = attrColumnNames[0];
                isAttrColumnExpressionFormula = false;
                final List<Selectable> selectables = basicBootValue.getSelectables();
                assert !selectables.isEmpty();
                final Selectable selectable = selectables.get(0);
                assert attrColumnExpression.equals(selectable.getText(sessionFactory.getJdbcServices().getDialect()));
                customReadExpr = selectable.getTemplate(dialect, sessionFactory.getTypeConfiguration(), sessionFactory.getQueryEngine().getSqmFunctionRegistry());
                customWriteExpr = selectable.getCustomWriteExpression();
                Column column = bootValue.getColumns().get(0);
                columnDefinition = column.getSqlType();
                length = column.getLength();
                precision = column.getPrecision();
                scale = column.getScale();
            } else {
                final String[] attrColumnFormulaTemplate = propertyColumnFormulaTemplates[propertyIndex];
                attrColumnExpression = attrColumnFormulaTemplate[0];
                isAttrColumnExpressionFormula = true;
                customReadExpr = null;
                customWriteExpr = null;
                columnDefinition = null;
                length = null;
                precision = null;
                scale = null;
            }
        }
        return MappingModelCreationHelper.buildBasicAttributeMapping(attrName, getNavigableRole().append(bootProperty.getName()), stateArrayPosition, bootProperty, this, (BasicType<?>) attrType, tableExpression, attrColumnExpression, isAttrColumnExpressionFormula, customReadExpr, customWriteExpr, columnDefinition, length, precision, scale, propertyAccess, tupleAttrDefinition.getCascadeStyle(), creationProcess);
    } else if (attrType instanceof AnyType) {
        final JavaType<Object> baseAssociationJtd = sessionFactory.getTypeConfiguration().getJavaTypeRegistry().getDescriptor(Object.class);
        final AnyType anyType = (AnyType) attrType;
        return new DiscriminatedAssociationAttributeMapping(navigableRole.append(bootProperty.getName()), baseAssociationJtd, this, stateArrayPosition, entityMappingType -> new AttributeMetadata() {

            private final MutabilityPlan<?> mutabilityPlan = new DiscriminatedAssociationAttributeMapping.MutabilityPlanImpl(anyType);

            private final boolean nullable = bootProperty.isOptional();

            private final boolean insertable = bootProperty.isInsertable();

            private final boolean updateable = bootProperty.isUpdateable();

            private final boolean optimisticallyLocked = bootProperty.isOptimisticLocked();

            @Override
            public PropertyAccess getPropertyAccess() {
                return propertyAccess;
            }

            @Override
            public MutabilityPlan<?> getMutabilityPlan() {
                return mutabilityPlan;
            }

            @Override
            public boolean isNullable() {
                return nullable;
            }

            @Override
            public boolean isInsertable() {
                return insertable;
            }

            @Override
            public boolean isUpdatable() {
                return updateable;
            }

            @Override
            public boolean isIncludedInDirtyChecking() {
                return updateable;
            }

            @Override
            public boolean isIncludedInOptimisticLocking() {
                return optimisticallyLocked;
            }
        }, bootProperty.isLazy() ? FetchTiming.DELAYED : FetchTiming.IMMEDIATE, propertyAccess, bootProperty, (AnyType) attrType, (Any) bootProperty.getValue(), creationProcess);
    } else if (attrType instanceof CompositeType) {
        return MappingModelCreationHelper.buildEmbeddedAttributeMapping(attrName, stateArrayPosition, bootProperty, this, (CompositeType) attrType, tableExpression, null, propertyAccess, tupleAttrDefinition.getCascadeStyle(), creationProcess);
    } else if (attrType instanceof CollectionType) {
        return MappingModelCreationHelper.buildPluralAttributeMapping(attrName, stateArrayPosition, bootProperty, this, propertyAccess, tupleAttrDefinition.getCascadeStyle(), getFetchMode(stateArrayPosition), creationProcess);
    } else if (attrType instanceof EntityType) {
        return MappingModelCreationHelper.buildSingularAssociationAttributeMapping(attrName, getNavigableRole().append(attrName), stateArrayPosition, bootProperty, this, this, (EntityType) attrType, propertyAccess, tupleAttrDefinition.getCascadeStyle(), creationProcess);
    }
    return null;
}
Also used : Alias(org.hibernate.sql.Alias) Property(org.hibernate.mapping.Property) SqlFragmentPredicate(org.hibernate.persister.internal.SqlFragmentPredicate) BasicType(org.hibernate.type.BasicType) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) ClassMetadata(org.hibernate.metadata.ClassMetadata) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) ReferenceCacheEntryImpl(org.hibernate.cache.spi.entry.ReferenceCacheEntryImpl) MappingModelCreationHelper(org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper) Expectations(org.hibernate.jdbc.Expectations) PostInsertIdentifierGenerator(org.hibernate.id.PostInsertIdentifierGenerator) Map(java.util.Map) EntityVersionMapping(org.hibernate.metamodel.mapping.EntityVersionMapping) SqlSelection(org.hibernate.sql.ast.spi.SqlSelection) IdentifierGenerator(org.hibernate.id.IdentifierGenerator) Optimizer(org.hibernate.id.enhanced.Optimizer) SingleIdEntityLoader(org.hibernate.loader.ast.spi.SingleIdEntityLoader) GeneratedValuesProcessor(org.hibernate.metamodel.mapping.internal.GeneratedValuesProcessor) LazyAttributeDescriptor(org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeDescriptor) Value(org.hibernate.mapping.Value) PreparedStatement(java.sql.PreparedStatement) SimpleFromClauseAccessImpl(org.hibernate.sql.ast.spi.SimpleFromClauseAccessImpl) Subclass(org.hibernate.mapping.Subclass) SqlAliasBase(org.hibernate.sql.ast.spi.SqlAliasBase) Serializable(java.io.Serializable) SqlExpressionResolver(org.hibernate.sql.ast.spi.SqlExpressionResolver) CacheHelper(org.hibernate.engine.internal.CacheHelper) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) PersisterCreationContext(org.hibernate.persister.spi.PersisterCreationContext) SqmMutationStrategyHelper(org.hibernate.query.sqm.mutation.internal.SqmMutationStrategyHelper) TooManyRowsAffectedException(org.hibernate.jdbc.TooManyRowsAffectedException) Dialect(org.hibernate.dialect.Dialect) CascadeStyle(org.hibernate.engine.spi.CascadeStyle) FetchMode(org.hibernate.FetchMode) UnstructuredCacheEntry(org.hibernate.cache.spi.entry.UnstructuredCacheEntry) CollectionPersister(org.hibernate.persister.collection.CollectionPersister) EnhancementHelper(org.hibernate.bytecode.enhance.spi.interceptor.EnhancementHelper) SelfDirtinessTracker(org.hibernate.engine.spi.SelfDirtinessTracker) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) SimpleNaturalIdMapping(org.hibernate.metamodel.mapping.internal.SimpleNaturalIdMapping) JdbcEnvironment(org.hibernate.engine.jdbc.env.spi.JdbcEnvironment) AssertionFailure(org.hibernate.AssertionFailure) SingleIdEntityLoaderDynamicBatch(org.hibernate.loader.ast.internal.SingleIdEntityLoaderDynamicBatch) FilterHelper(org.hibernate.internal.FilterHelper) QueryOptions(org.hibernate.query.spi.QueryOptions) Session(org.hibernate.Session) SessionFactoryOptions(org.hibernate.boot.spi.SessionFactoryOptions) EntityDataAccess(org.hibernate.cache.spi.access.EntityDataAccess) Metadata(org.hibernate.boot.Metadata) Supplier(java.util.function.Supplier) NaturalIdResolutions(org.hibernate.engine.spi.NaturalIdResolutions) SemanticException(org.hibernate.query.SemanticException) EntityVersionMappingImpl(org.hibernate.metamodel.mapping.internal.EntityVersionMappingImpl) LinkedHashMap(java.util.LinkedHashMap) NamedTableReference(org.hibernate.sql.ast.tree.from.NamedTableReference) MultiIdLoadOptions(org.hibernate.loader.ast.spi.MultiIdLoadOptions) Preparable(org.hibernate.loader.ast.internal.Preparable) DiscriminatedAssociationAttributeMapping(org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationAttributeMapping) ToOneAttributeMapping(org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping) StandardTableGroup(org.hibernate.sql.ast.tree.from.StandardTableGroup) InFlightEntityMappingType(org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType) LoaderSelectBuilder(org.hibernate.loader.ast.internal.LoaderSelectBuilder) LazyAttributesMetadata(org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributesMetadata) SimpleSelect(org.hibernate.sql.SimpleSelect) EntityDiscriminatorMapping(org.hibernate.metamodel.mapping.EntityDiscriminatorMapping) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) EntityKey(org.hibernate.engine.spi.EntityKey) Table(org.hibernate.mapping.Table) Fetch(org.hibernate.sql.results.graph.Fetch) NaturalIdLoader(org.hibernate.loader.ast.spi.NaturalIdLoader) QueryableCollection(org.hibernate.persister.collection.QueryableCollection) Template(org.hibernate.sql.Template) FromClauseAccess(org.hibernate.sql.ast.spi.FromClauseAccess) TreeMap(java.util.TreeMap) BytecodeLazyAttributeInterceptor(org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor) NaturalIdMapping(org.hibernate.metamodel.mapping.NaturalIdMapping) SqlSelectionImpl(org.hibernate.sql.results.internal.SqlSelectionImpl) CachedNaturalIdValueSource(org.hibernate.engine.spi.CachedNaturalIdValueSource) AssociationType(org.hibernate.type.AssociationType) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) AnyType(org.hibernate.type.AnyType) EntityResultImpl(org.hibernate.sql.results.graph.entity.internal.EntityResultImpl) SingleIdEntityLoaderStandardImpl(org.hibernate.loader.ast.internal.SingleIdEntityLoaderStandardImpl) PersistentCollection(org.hibernate.collection.spi.PersistentCollection) LockModeEnumMap(org.hibernate.internal.util.collections.LockModeEnumMap) Locale(java.util.Locale) Binder(org.hibernate.id.insert.Binder) ComparisonOperator(org.hibernate.query.sqm.ComparisonOperator) LazyPropertyInitializer(org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer) PersistentAttributeInterceptable(org.hibernate.engine.spi.PersistentAttributeInterceptable) Formula(org.hibernate.mapping.Formula) Collection(java.util.Collection) StaleObjectStateException(org.hibernate.StaleObjectStateException) Column(org.hibernate.mapping.Column) StatisticsImplementor(org.hibernate.stat.spi.StatisticsImplementor) BasicBatchKey(org.hibernate.engine.jdbc.batch.internal.BasicBatchKey) Objects(java.util.Objects) ArrayHelper(org.hibernate.internal.util.collections.ArrayHelper) EntityRowIdMappingImpl(org.hibernate.metamodel.mapping.internal.EntityRowIdMappingImpl) Queryable(org.hibernate.metamodel.mapping.Queryable) Update(org.hibernate.sql.Update) LoaderSqlAstCreationState(org.hibernate.loader.ast.internal.LoaderSqlAstCreationState) SelectableConsumer(org.hibernate.metamodel.mapping.SelectableConsumer) IndexedConsumer(org.hibernate.mapping.IndexedConsumer) DomainResultCreationState(org.hibernate.sql.results.graph.DomainResultCreationState) OptimisticLockStyle(org.hibernate.engine.OptimisticLockStyle) CacheEntityLoaderHelper(org.hibernate.loader.entity.CacheEntityLoaderHelper) JdbcMapping(org.hibernate.metamodel.mapping.JdbcMapping) RootClass(org.hibernate.mapping.RootClass) OptimizableGenerator(org.hibernate.id.OptimizableGenerator) TableReference(org.hibernate.sql.ast.tree.from.TableReference) HashSet(java.util.HashSet) ModelPart(org.hibernate.metamodel.mapping.ModelPart) Loader(org.hibernate.loader.ast.spi.Loader) CompositeType(org.hibernate.type.CompositeType) ManagedMappingType(org.hibernate.metamodel.mapping.ManagedMappingType) LockingStrategy(org.hibernate.dialect.lock.LockingStrategy) DiscriminatedAssociationModelPart(org.hibernate.metamodel.mapping.DiscriminatedAssociationModelPart) SqlAliasBaseManager(org.hibernate.sql.ast.spi.SqlAliasBaseManager) InsertGeneratedIdentifierDelegate(org.hibernate.id.insert.InsertGeneratedIdentifierDelegate) EntityEntryFactory(org.hibernate.engine.spi.EntityEntryFactory) SqmFunctionRegistry(org.hibernate.query.sqm.function.SqmFunctionRegistry) EntityMetamodel(org.hibernate.tuple.entity.EntityMetamodel) MappingModelCreationProcess(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess) Consumer(java.util.function.Consumer) EntityRepresentationStrategy(org.hibernate.metamodel.spi.EntityRepresentationStrategy) JdbcParameter(org.hibernate.sql.ast.tree.expression.JdbcParameter) SelectableMapping(org.hibernate.metamodel.mapping.SelectableMapping) Selectable(org.hibernate.mapping.Selectable) NonAggregatedIdentifierMapping(org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping) EntityEntry(org.hibernate.engine.spi.EntityEntry) BitSet(java.util.BitSet) Comparator(java.util.Comparator) MutableEntityEntryFactory(org.hibernate.engine.internal.MutableEntityEntryFactory) MultiIdLoaderStandard(org.hibernate.loader.ast.internal.MultiIdLoaderStandard) Arrays(java.util.Arrays) EventSource(org.hibernate.event.spi.EventSource) ReflectionOptimizer(org.hibernate.bytecode.spi.ReflectionOptimizer) PersistenceContext(org.hibernate.engine.spi.PersistenceContext) PropertyAccess(org.hibernate.property.access.spi.PropertyAccess) SingleUniqueKeyEntityLoaderStandard(org.hibernate.loader.ast.internal.SingleUniqueKeyEntityLoaderStandard) ForeignKeyDescriptor(org.hibernate.metamodel.mapping.ForeignKeyDescriptor) PersistentClass(org.hibernate.mapping.PersistentClass) ResultSet(java.sql.ResultSet) MultiIdEntityLoader(org.hibernate.loader.ast.spi.MultiIdEntityLoader) LazyAttributeLoadingInterceptor(org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor) Insert(org.hibernate.sql.Insert) StaleStateException(org.hibernate.StaleStateException) SingleUniqueKeyEntityLoader(org.hibernate.loader.ast.spi.SingleUniqueKeyEntityLoader) BytecodeEnhancementMetadata(org.hibernate.bytecode.spi.BytecodeEnhancementMetadata) Fetchable(org.hibernate.sql.results.graph.Fetchable) StructuredCacheEntry(org.hibernate.cache.spi.entry.StructuredCacheEntry) LockOptions(org.hibernate.LockOptions) ImmutableEntityEntryFactory(org.hibernate.engine.internal.ImmutableEntityEntryFactory) StringHelper(org.hibernate.internal.util.StringHelper) Set(java.util.Set) Expression(org.hibernate.sql.ast.tree.expression.Expression) SingleIdArrayLoadPlan(org.hibernate.loader.ast.internal.SingleIdArrayLoadPlan) NavigablePath(org.hibernate.spi.NavigablePath) Assigned(org.hibernate.id.Assigned) LazyValue(org.hibernate.internal.util.LazyValue) EntityIdentifierMapping(org.hibernate.metamodel.mapping.EntityIdentifierMapping) BasicEntityIdentifierMappingImpl(org.hibernate.metamodel.mapping.internal.BasicEntityIdentifierMappingImpl) Expectation(org.hibernate.jdbc.Expectation) RuntimeModelCreationContext(org.hibernate.metamodel.spi.RuntimeModelCreationContext) EnhancementAsProxyLazinessInterceptor(org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor) HibernateException(org.hibernate.HibernateException) CacheEntryStructure(org.hibernate.cache.spi.entry.CacheEntryStructure) QueryException(org.hibernate.QueryException) MutabilityPlan(org.hibernate.type.descriptor.java.MutabilityPlan) JavaType(org.hibernate.type.descriptor.java.JavaType) Setter(org.hibernate.property.access.spi.Setter) Clause(org.hibernate.sql.ast.Clause) ArrayList(java.util.ArrayList) StandardCacheEntryImpl(org.hibernate.cache.spi.entry.StandardCacheEntryImpl) ValueGeneration(org.hibernate.tuple.ValueGeneration) SQLException(java.sql.SQLException) BiConsumer(java.util.function.BiConsumer) PostInsertIdentityPersister(org.hibernate.id.PostInsertIdentityPersister) FetchTiming(org.hibernate.engine.FetchTiming) BulkInsertionCapableIdentifierGenerator(org.hibernate.id.BulkInsertionCapableIdentifierGenerator) SingularAttributeMapping(org.hibernate.metamodel.mapping.SingularAttributeMapping) Delete(org.hibernate.sql.Delete) StatefulPersistenceContext(org.hibernate.engine.internal.StatefulPersistenceContext) CompoundNaturalIdMapping(org.hibernate.metamodel.mapping.internal.CompoundNaturalIdMapping) LoadEvent(org.hibernate.event.spi.LoadEvent) MultiNaturalIdLoader(org.hibernate.loader.ast.spi.MultiNaturalIdLoader) CollectionHelper(org.hibernate.internal.util.collections.CollectionHelper) NamedQueryMemento(org.hibernate.query.named.NamedQueryMemento) SqmMultiTableMutationStrategy(org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy) Filter(org.hibernate.Filter) SQLQueryParser(org.hibernate.query.sql.internal.SQLQueryParser) Lifecycle(org.hibernate.classic.Lifecycle) MessageHelper(org.hibernate.pretty.MessageHelper) Any(org.hibernate.mapping.Any) EntityBasedAssociationAttribute(org.hibernate.tuple.entity.EntityBasedAssociationAttribute) MappingModelHelper(org.hibernate.metamodel.mapping.MappingModelHelper) SqlAstCreationContext(org.hibernate.sql.ast.spi.SqlAstCreationContext) NonIdentifierAttribute(org.hibernate.tuple.NonIdentifierAttribute) ComparisonPredicate(org.hibernate.sql.ast.tree.predicate.ComparisonPredicate) JDBCException(org.hibernate.JDBCException) PersistentAttributeInterceptor(org.hibernate.engine.spi.PersistentAttributeInterceptor) ExecuteUpdateResultCheckStyle(org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle) TableReferenceJoin(org.hibernate.sql.ast.tree.from.TableReferenceJoin) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) CacheEntry(org.hibernate.cache.spi.entry.CacheEntry) AttributeMetadataAccess(org.hibernate.metamodel.mapping.AttributeMetadataAccess) IdentityHashMap(java.util.IdentityHashMap) DependantValue(org.hibernate.mapping.DependantValue) VirtualModelPart(org.hibernate.metamodel.mapping.VirtualModelPart) DomainResult(org.hibernate.sql.results.graph.DomainResult) SqmMultiTableInsertStrategy(org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy) NavigableRole(org.hibernate.metamodel.model.domain.NavigableRole) LoadQueryInfluencers(org.hibernate.engine.spi.LoadQueryInfluencers) List(java.util.List) EntityInstantiator(org.hibernate.metamodel.spi.EntityInstantiator) SingleIdEntityLoaderProvidedQueryImpl(org.hibernate.loader.ast.internal.SingleIdEntityLoaderProvidedQueryImpl) MappingException(org.hibernate.MappingException) BasicValue(org.hibernate.mapping.BasicValue) SessionImplementor(org.hibernate.engine.spi.SessionImplementor) QuerySpec(org.hibernate.sql.ast.tree.select.QuerySpec) SortedMap(java.util.SortedMap) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) BasicValuedModelPart(org.hibernate.metamodel.mapping.BasicValuedModelPart) CoreMessageLogger(org.hibernate.internal.CoreMessageLogger) Junction(org.hibernate.sql.ast.tree.predicate.Junction) InDatabaseValueGenerationStrategy(org.hibernate.tuple.InDatabaseValueGenerationStrategy) ColumnReference(org.hibernate.sql.ast.tree.expression.ColumnReference) CollectionType(org.hibernate.type.CollectionType) HashMap(java.util.HashMap) SqlAliasStemHelper(org.hibernate.sql.ast.spi.SqlAliasStemHelper) InMemoryValueGenerationStrategy(org.hibernate.tuple.InMemoryValueGenerationStrategy) EntityType(org.hibernate.type.EntityType) RepresentationMode(org.hibernate.metamodel.RepresentationMode) FilterAliasGenerator(org.hibernate.internal.FilterAliasGenerator) AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) SqlAliasBaseConstant(org.hibernate.sql.ast.spi.SqlAliasBaseConstant) SqlAstCreationState(org.hibernate.sql.ast.spi.SqlAstCreationState) LockMode(org.hibernate.LockMode) Predicate(org.hibernate.sql.ast.tree.predicate.Predicate) Versioning(org.hibernate.engine.internal.Versioning) AliasedExpression(org.hibernate.sql.ast.tree.expression.AliasedExpression) ExplicitColumnDiscriminatorMappingImpl(org.hibernate.metamodel.mapping.internal.ExplicitColumnDiscriminatorMappingImpl) SelectClause(org.hibernate.sql.ast.tree.select.SelectClause) Association(org.hibernate.metamodel.mapping.Association) EntityRowIdMapping(org.hibernate.metamodel.mapping.EntityRowIdMapping) GenerationTiming(org.hibernate.tuple.GenerationTiming) Component(org.hibernate.mapping.Component) CollectionKey(org.hibernate.engine.spi.CollectionKey) LazyInitializationException(org.hibernate.LazyInitializationException) EmbeddableValuedModelPart(org.hibernate.metamodel.mapping.EmbeddableValuedModelPart) NaturalIdDataAccess(org.hibernate.cache.spi.access.NaturalIdDataAccess) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) Collections(java.util.Collections) CoreLogging(org.hibernate.internal.CoreLogging) Type(org.hibernate.type.Type) BasicType(org.hibernate.type.BasicType) DiscriminatedAssociationAttributeMapping(org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationAttributeMapping) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) JdbcEnvironment(org.hibernate.engine.jdbc.env.spi.JdbcEnvironment) Any(org.hibernate.mapping.Any) BasicValue(org.hibernate.mapping.BasicValue) Column(org.hibernate.mapping.Column) Selectable(org.hibernate.mapping.Selectable) CollectionType(org.hibernate.type.CollectionType) Dialect(org.hibernate.dialect.Dialect) MutabilityPlan(org.hibernate.type.descriptor.java.MutabilityPlan) AnyType(org.hibernate.type.AnyType) DependantValue(org.hibernate.mapping.DependantValue) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) PropertyAccess(org.hibernate.property.access.spi.PropertyAccess) EntityType(org.hibernate.type.EntityType) BasicType(org.hibernate.type.BasicType) EntityMappingType(org.hibernate.metamodel.mapping.EntityMappingType) InFlightEntityMappingType(org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType) AssociationType(org.hibernate.type.AssociationType) AnyType(org.hibernate.type.AnyType) CompositeType(org.hibernate.type.CompositeType) ManagedMappingType(org.hibernate.metamodel.mapping.ManagedMappingType) JavaType(org.hibernate.type.descriptor.java.JavaType) CollectionType(org.hibernate.type.CollectionType) EntityType(org.hibernate.type.EntityType) Type(org.hibernate.type.Type) JavaType(org.hibernate.type.descriptor.java.JavaType) AttributeMetadata(org.hibernate.metamodel.mapping.AttributeMetadata) Value(org.hibernate.mapping.Value) LazyValue(org.hibernate.internal.util.LazyValue) DependantValue(org.hibernate.mapping.DependantValue) BasicValue(org.hibernate.mapping.BasicValue) CompositeType(org.hibernate.type.CompositeType)

Aggregations

AttributeMetadata (org.hibernate.metamodel.mapping.AttributeMetadata)10 EntityMappingType (org.hibernate.metamodel.mapping.EntityMappingType)7 EntityPersister (org.hibernate.persister.entity.EntityPersister)7 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)6 SingularAttributeMapping (org.hibernate.metamodel.mapping.SingularAttributeMapping)6 MappingException (org.hibernate.MappingException)5 Dialect (org.hibernate.dialect.Dialect)5 BasicValue (org.hibernate.mapping.BasicValue)5 Serializable (java.io.Serializable)4 CascadeStyle (org.hibernate.engine.spi.CascadeStyle)4 Any (org.hibernate.mapping.Any)4 PluralAttributeMapping (org.hibernate.metamodel.mapping.PluralAttributeMapping)4 List (java.util.List)3 SortedMap (java.util.SortedMap)3 NotYetImplementedFor6Exception (org.hibernate.NotYetImplementedFor6Exception)3 SharedSessionContract (org.hibernate.SharedSessionContract)3 FetchTiming (org.hibernate.engine.FetchTiming)3 JdbcEnvironment (org.hibernate.engine.jdbc.env.spi.JdbcEnvironment)3 JdbcServices (org.hibernate.engine.jdbc.spi.JdbcServices)3 Column (org.hibernate.mapping.Column)3