Top For Removal Deprecated
Hibernate ORM - hibernate-core 6.4.4.Final

Deprecated API


Terminally Deprecated Item Summary

SinceTerminally Deprecated Item and Description
6.2

Returns:

this, if this has null for getQueryString(); otherwise a new QueryException (or subclass) is returned.
org.hibernate.QueryException.wrapWithQueryString
(String
The query string that led to the QueryException
queryString
)

This method is no longer used

Returns:

this, for method chaining
org.hibernate.SessionBuilder.tenantIdentifier
(String
The tenant identifier.
tenantIdentifier
)

Use tenantIdentifier(Object) instead

Returns:

this, for method chaining
org.hibernate.StatelessSessionBuilder.tenantIdentifier
(String
The tenant identifier.
tenantIdentifier
)

Use tenantIdentifier(Object) instead

6.3

Returns:

the equivalent instance of GenerationTiming
org.hibernate.annotations.GenerationTime.getEquivalent
()

Needed for backwards compatibility until the deprecated, legacy generation stuff can be removed

6.3
org.hibernate.annotations.OrderBy

Use SQLOrder instead. This annotation will be removed eventually, since its unqualified name collides with jakarta.persistence.OrderBy.

6.2
org.hibernate.annotations.Table

The options available here are all now offered by other newer and better-designed annotations in this package. This annotation will soon be removed, since it's very annoying to have two annotations named @Table.

6.0
6.2
6.2
6

Returns:

this for method chaining
org.hibernate.boot.MetadataBuilder.applySourceProcessOrdering
(MetadataSourceType...
The types, in the order they should be processed
sourceTypes
)

hbm.xml mappings are no longer supported, making this irrelevant

6.2
6.2

Returns:

true indicates that dirty checking should be in-lined within the entity; false indicates it should not. In-lined is more easily serializable and probably more performant.
org.hibernate.bytecode.enhance.spi.EnhancementContext.doDirtyCheckingInline
(UnloadedClass
The descriptor of the class to check.
classDescriptor
)

Will be removed without replacement. See HHH-15641

Returns:

true/false
org.hibernate.bytecode.enhance.spi.EnhancementContext.hasLazyLoadableAttributes
(UnloadedClass
The class to check
classDescriptor
)

Will be removed without replacement. See HHH-15641

Returns:

The reflection optimization delegate.
org.hibernate.bytecode.spi.BytecodeProvider.getReflectionOptimizer
(Class<T>
The class to be reflected upon.
clazz
,
String[]
Names of all property getters to be accessed via reflection.
getterNames
,
String[]
Names of all property setters to be accessed via reflection.
setterNames
,
Class<T>[]
The types of all properties to be accessed.
types
)

Use getReflectionOptimizer(Class, Map) insstead

6.2
org.hibernate.cfg.AvailableSettings.FLUSH_MODE

There are much better ways to control the flush mode of a session, for example, org.hibernate.SessionBuilder#flushMode or org.hibernate.Session#setHibernateFlushMode.

org.hibernate.cfg.BytecodeSettings.BYTECODE_PROVIDER

Will be removed, Hibernate ORM will use the BytecodeProvider implementation it finds on the classpath loading it via the standard ServiceLoader mechanism. Currently, there is only a single implementation which is included in Hibernate ORM, so it's not possible to override this. See HHH-17643

org.hibernate.cfg.BytecodeSettings.ENHANCER_ENABLE_DIRTY_TRACKING

Will be removed without replacement. See HHH-15641

org.hibernate.cfg.BytecodeSettings.ENHANCER_ENABLE_LAZY_INITIALIZATION

Will be removed without replacement. See HHH-15641

6
6
org.hibernate.cfg.MappingSettings.ARTIFACT_PROCESSING_ORDER

hbm.xml mappings are no longer supported, making this attribute irrelevant

6.2
org.hibernate.cfg.MappingSettings.USE_ENTITY_WHERE_CLAUSE_FOR_COLLECTIONS

Originally added as a backwards compatibility flag

6
org.hibernate.cfg.MetadataSourceType

hbm.xml mappings are no longer supported, making this attribute irrelevant

6
6
6
org.hibernate.dialect.Dialect.inlineLiteral(String literal)

This is no longer called

6

Returns:

True if the lock timeout is rendered into the SQL string as a parameter; false otherwise.
org.hibernate.dialect.Dialect.isLockTimeoutParameterized
()

This is never called, and since at least Hibernate 5 has just returned false in every dialect. It will be removed.

6

Returns:

True if this is supported; false otherwise.
org.hibernate.dialect.Dialect.supportsParametersInInsertSelect
()

This seems to be supported on all platforms, and we don't call this except in test suite

org.hibernate.dialect.Dialect.trimPattern(TrimSpec
leading or trailing
specification
,
char
the character to trim
character
)

Use trimPattern(TrimSpec, boolean) instead.

6
6
6
6.2
org.hibernate.engine.OptimisticLockStyle.getOldCode()

these integer codes have not been used for a long time

6.2

Returns:

The interpreted enum value
org.hibernate.engine.OptimisticLockStyle.interpretOldCode
(int
The old int constant code
oldCode
)

these integer codes have not been used for a long time

org.hibernate.engine.profile.Fetch.Fetch(Association
The association to be fetched
association
,
Fetch.Style
How to fetch it
style
)

use Fetch(Association, FetchStyle, FetchTiming)

org.hibernate.engine.profile.FetchProfile.addFetch(Association
The association to be fetched
association
,
String
The name of the fetch style to apply
fetchStyleName
)

No longer used

org.hibernate.engine.profile.FetchProfile.addFetch(Association
The association to be fetched
association
,
Fetch.Style
The style to apply
style
)

No longer used

Returns:

Value for property 'containsJoinFetchedBag'.
org.hibernate.engine.profile.FetchProfile.isContainsJoinFetchedBag
()

No longer used

6.4
6.2
6.2
6.2
6.2
6
6
org.hibernate.engine.spi.SharedSessionContractImplementor.setEnforcingFetchGraph(boolean enforcingFetchGraph)

this is not used anywhere

6.2
6
org.hibernate.id.ForeignGenerator

This remains around as an implementation detail of hbm.xml mappings.

6.2
6.2
6.2
org.hibernate.id.ResultSetIdentifierConsumer

this interface is unnecessary and no longer used

6.2
5.4
6.2
org.hibernate.jpa.boot.spi.TypeContributorList

Consider using discovery instead to dynamically locate contributors.

6.0
6
6
6.2
org.hibernate.mapping.Constraint.sqlConstraintString(SqlStringGenerationContext context, String constraintName, String defaultCatalog, String defaultSchema)

this method is no longer called

org.hibernate.mapping.FetchProfile.addFetch(String
The entity which contains the association to be fetched
entity
,
String
The association to fetch
association
,
String
The style of fetch to apply
style
)

use addFetch(Fetch)

6.2
6.3
org.hibernate.mapping.Index.buildSqlCreateIndexString(Dialect dialect, String name, String tableName, List<Column> columns, Map<Column, String> columnOrderMap, boolean unique)

This method will be removed in the next release

org.hibernate.mapping.Index.buildSqlCreateIndexString(SqlStringGenerationContext context, String name, Table table, List<Column> columns, Map<Column, String> columnOrderMap, boolean unique, Metadata metadata)

This method will be removed in the next release

org.hibernate.mapping.Index.buildSqlDropIndexString(String name, String tableName)

This method will be removed in the next release

6.3
6.3
6.2
org.hibernate.mapping.PersistentClass.getSubclassProperty(String propertyName)

This will be removed with no replacement.

6.2
6
org.hibernate.mapping.Property.isPrimitive(Class<?> clazz)

this method is no longer used

6.3
6.2
6.2
6.2
org.hibernate.metamodel.mapping.EntityMappingType.pruneForSubclasses(TableGroup
The table group to prune subclass tables for
tableGroup
,
Set<String>
The entity names for which path usages were registered
treatedEntityNames
)

Use pruneForSubclasses(TableGroup, Map) instead

org.hibernate.metamodel.model.domain.internal.EntityPersisterConcurrentMap.convertToMap()

Higly inefficient - do not use; this exists to support other deprecated methods and will be removed.

org.hibernate.persister.collection.CollectionPersister.getCollectionType()

Hibernate is moving away from Type. Corresponding mapping metamodel calls should be used instead - here (generally), PluralAttributeMapping

6

Returns:

The key column aliases.
org.hibernate.persister.collection.CollectionPersister.getElementColumnAliases
(String
The suffix to use in the element column alias generation.
suffix
)

Read-by-position makes this irrelevant. Currently still used by org.hibernate.query.sql.internal.SQLQueryParser

6

Returns:

The key column aliases.
org.hibernate.persister.collection.CollectionPersister.getIdentifierColumnAlias
(String
The suffix to use in the key column alias generation.
suffix
)

Read-by-position makes this irrelevant. Currently still used by org.hibernate.query.sql.internal.SQLQueryParser

6

Returns:

The key column aliases, or null if not indexed.
org.hibernate.persister.collection.CollectionPersister.getIndexColumnAliases
(String
The suffix to use in the index column alias generation.
suffix
)

Read-by-position makes this irrelevant. Currently still used by org.hibernate.query.sql.internal.SQLQueryParser

6

Returns:

The key column aliases.
org.hibernate.persister.collection.CollectionPersister.getKeyColumnAliases
(String
The suffix to use in the key column alias generation.
suffix
)

Read-by-position makes this irrelevant. Currently still used by org.hibernate.query.sql.internal.SQLQueryParser

org.hibernate.persister.collection.CollectionPersister.getKeyType()

Hibernate is moving away from Type. Corresponding mapping metamodel calls should be used instead - here, PluralAttributeMapping#getKeyDescriptor()

6
6
6
org.hibernate.persister.collection.QueryableCollection

Given the mapping-model and SQM, this contract is no longer needed. Note however that org.hibernate.query.sql.internal.SQLQueryParser currently uses this along with other

org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(final Object id, final Object[] fields, final Object rowId, final boolean[] includeProperty, final boolean[][] includeColumns, final int j, final PreparedStatement ps, final SharedSessionContractImplementor session, int index, boolean isUpdate)

No longer used.

6.2
6
6

Returns:

Array of booleans indicating which table require updating.
org.hibernate.persister.entity.AbstractEntityPersister.getTableUpdateNeeded
(final int[]
The indices of all the entity properties considered dirty.
dirtyProperties
,
boolean
Whether any collections owned by the entity which were considered dirty.
hasDirtyCollection
)

No longer used. See UpdateCoordinator

6.2
6
6
6
6
6
6
6
6.2
org.hibernate.persister.entity.DiscriminatorMetadata

The functionality of DiscriminatorMetadata, DiscriminatorType and MetaType have been consolidated into EntityDiscriminatorMapping and DiscriminatorConverter

6.2
6

Returns:

The type.
org.hibernate.persister.entity.EntityPersister.getPropertyType
(String
The name of the property for which to retrieve the type.
propertyName
)

See findAttributeMapping(String)

6
6
6
6
6
6
6.3
org.hibernate.query.sqm.InterpretationException.InterpretationException(String message)

this constructor does not carry information about the query which caused the failure

5.4
org.hibernate.resource.jdbc.spi.JdbcObserver

It is no longer possible to plug custom implementations of this SPI. It will be removed.

6.2
org.hibernate.resource.jdbc.spi.JdbcSessionContext.getFetchSize()

this is never called, and luckily so, because it's not null-safe

org.hibernate.sql.ast.spi.SqlSelectionProducer.createSqlSelection(int
The index position used to read values from JDBC
jdbcPosition
,
int
The position in our "current JDBC values array"
valuesArrayPosition
,
JavaType<T>
The descriptor for the Java type to read the value as
javaType
,
TypeConfiguration
The associated TypeConfiguration
typeConfiguration
)

Use createSqlSelection(int, int, JavaType, boolean, TypeConfiguration) instead

org.hibernate.sql.ast.tree.expression.Expression.createDomainResultSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType<T> javaType, TypeConfiguration typeConfiguration)

6
org.hibernate.sql.model.MutationOperationGroup.forEachOperation(BiConsumer<Integer, O> action)

Will be removed. Use the other methods to visit each operation.

org.hibernate.sql.model.MutationOperationGroup.hasMatching(BiFunction<Integer, O, Boolean> matcher)

Will be removed. Use the other methods to visit each operation.

6.2
org.hibernate.tuple.AnnotationValueGeneration<
The generator annotation type supported by an implementation
A extends Annotation
>

Replaced by AnnotationBasedGenerator

6.2
org.hibernate.tuple.GenerationTiming

Replaced by EventType as id-generation has been redefined using the new broader generation approach.

6.2
6.2
6
org.hibernate.tuple.entity.EntityMetamodel

Replaced by EntityMappingType. EntityMetamodel was a first attempt at what has become EntityMappingType

org.hibernate.type.ComponentType.ComponentType(Component component, int[] originalPropertyOrder, MetadataBuildingContext context)

6.2
org.hibernate.type.EnumType<T extends Enum<T>>

Use the built-in support for enums

6.2

Returns:

The SQL type name
org.hibernate.type.descriptor.sql.DdlType.getCastTypeName
(SqlExpressible type, Long
the length, or null, if unspecified
length
,
Integer
the precision, or null, if unspecified
precision
,
Integer
the scale, or null, if unspecified
scale
)

Use getCastTypeName(Size, SqlExpressible, DdlTypeRegistry) instead