Deprecated API
Contents
- Terminally Deprecated
- Packages
- Interfaces
- Classes
- Enum Classes
- Exception Classes
- Record Classes
- Annotation Interfaces
- Fields
- Methods
- Constructors
- Enum Constants
- Annotation Interface Elements
-
Terminally Deprecated ElementsElementDescriptionThis method is not used by
GraphBasedActionQueueand is only needed forActionQueueLegacy. It will be removed when the legacy implementation is removed.This method is not used byGraphBasedActionQueueand is only needed forActionQueueLegacy. It will be removed when the legacy implementation is removed.This method is not used byGraphBasedActionQueueand is only needed forActionQueueLegacy. It will be removed when the legacy implementation is removed.UseColumn.secondPrecision()which was introduced in JPA 3.2The influence of Jakarta Validation constraints on DDL schema generation is now enabled by default when the validation mode isValidationMode.AUTO. Use the setting "hibernate.tooling.schema.apply_validation_constraints" to control this behavior instead. To require that a Jakarta Validation provider is available (as this mode did), useREQUIRED.UseIdentifier.quoted().Use NamedStrategyContributor insteadUse NamedStrategyContributor insteadUse settings,TypeContributor,FunctionContributororAdditionalMappingContributorinstead depending on needWill be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-19660Use EnhancementOptions.doDirtyCheckingInline() instead.Will be removed without replacement. See HHH-19661Use EnhancementOptions.doExtendedEnhancement() instead.UseBytecodeProvider.getReflectionOptimizer(Class, Map)inssteadWill 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-17643Will be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-15641It's not necessary to set this explicitlyUseGlobalTemporaryTableStrategy.CREATE_ID_TABLES.UseGlobalTemporaryTableStrategy.DROP_ID_TABLES.UseLocalTemporaryTableStrategy.DROP_ID_TABLES.UsePersistentTableStrategy.CREATE_ID_TABLES.UsePersistentTableStrategy.DROP_ID_TABLES.UsePersistentBag.bagAsList()orPersistentBag.collectioninstead.UseSQLServerDialectinstead.useDialect.getCheckCondition(String, Long[])insteadNo longer usedUse Dialect.getNativeValueGenerationStrategy() insteadUseDialect.getLocalTemporaryTableStrategy()andDialect.getGlobalTemporaryTableStrategy()to check insteadNo longer usedUsed by the mutation handling from the legacy action queue. It is not needed for the graph-based queue.becauseorg.hibernate.annotations.CascadeType#LOCKwas removedNo longer called. Will be removed.becauseorg.hibernate.annotations.CascadeType#LOCKwas removedNo longer usedThis was only used in tests and can be quite safely removed. UseEventSource.getActionQueue().Use LockEvent(Object, LockOptions, EventSource) instead.Use LockEvent(String, Object, LockOptions, EventSource) instead.replaced byAssignedThis remains around as an implementation detail ofhbm.xmlmappings.since it overrides a deprecated methodThis is not an elegant way to do anythingUseGeneratedValuesMutationDelegateinstead.no longer set, useJdbcEnvironment.getIdentifierHelper()Use forms ofSession.find(Class, Object)acceptingFindOption} orSession.getReference(Class, Object, KeyType)instead.Use discovery instead.Consider using discovery instead to dynamically locate contributors.Consider using discovery instead to dynamically locate contributors.Use MultiIdLoadOptions.getSessionCheckMode() instead.Use MultiLoadOptions.getOrderingMode() instead.Use MultiLoadOptions.getRemovalsMode() instead.With no replacement; LockOptions is no longer considered an API.Since JPA 3.2 and Hibernate 7, aLockMode,Timeout, orPessimisticLockScopemay be passed directly as an option tofind(),refresh(), orlock(). Therefore, this class is obsolete as an API and will be moved to an SPI package.For HQL/JPQL queries, locking should be controlled via operations of the
SelectionQueryinterface:- A timeout may be set via
CommonQueryContract.setTimeout(Timeout) - The
PessimisticLockScopemay be set usingSelectionQuery.setLockScope(PessimisticLockScope) - Use of follow-on locking may be enabled via
SelectionQuery.setFollowOnStrategy(Locking.FollowOn)
Timeoutsprovides several operations to simplify migration.LockOptions will be made into a record.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Use LockOptions.getScope() insteadAlias-specific locks are no longer supported, roughly replaced with locking scope.LockOptions will be made into a record.LockOptions will be made into a record.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.LockOptions will be made into a record.This, and the other constants on this class, will be removed.Alias-specific locks are no longer supported, roughly replaced with locking scope.Use LockOptions.setScope(PessimisticLockScope) insteadThis, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.This is no longer needed after the introduction ofStateful.Use Session.findMultiple(Class, List, FindOption...) accepting options instead.Hibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here (generally),PluralAttributeMappingRead-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getElementDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getIdentifierDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getIndexDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getKeyDescriptor()No longer used in ORM coreTransitional interface - useLegacyEntityMutationTargetfor legacy coordinators orGraphEntityMutationTargetfor graph-based decomposersUsed by legacy action queue processes.useLegacyEntityMutationTarget.getInsertDelegate()insteadUseJpaCteContainer.with(String, AbstractQuery)and provide an explicit name for the CTEorg.hibernate.query.MutationOrSelectionQuery.setResultListTransformer(ResultListTransformer<Object>) Use MutationQuery instead for queries which mutate data.Use SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as fetch size is only relevant for selection queriesThe variousQuery<T>subtypes already expose all relevant options; furthermore, this operation is a layer-breaker, exposing theQueryOptionsSPI type via an API.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as read-only mode is only relevant for selection queriesUse SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as caching is only relevant for selection queriesPrefer passing the entity-graph while creating the query - SharedSessionContract.createSelectionQuery(String, EntityGraph)Use SelectionQuery instead as fetch size is only relevant for selection queriesUse SelectionQuery instead as read-only mode is only relevant for selection queriesUse SelectionQuery instead as result list transformation is only relevant for queries which return results.Use SelectionQuery instead as tuple transformation is only relevant for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Prefer passing the entity-graph while creating the query - SharedSessionContract.createSelectionQuery(String, EntityGraph)Prefer passing the entity-graph while creating the query - SharedSessionContract.createSelectionQuery(String, EntityGraph)This enumeration will be removed, and replaced with a simpler boolean-valued switch.SinceImmutableEntityUpdateQueryHandlingModeis deprecated. UseQueryEngineOptions.allowImmutableEntityUpdate()instead.this constructor does not carry information about the query which caused the failureImplementArgumentsValidator.validate(List, String, BindingContext)insteadwas previously used for HQL. UseSqmUpdateStatement(NodeBuilder)insteadwas previously used for Criteria. UseSqmUpdateStatement(Class, SqmCriteriaNodeBuilder)instead.UseSchemaManager.drop(boolean)instead.UseSchemaManager.create(boolean)instead.UseSchemaManager.truncate()instead.UseSchemaManager.validate()instead.This method will be removed. UseSession.find(Class,Object,FindOption...)instead. SeeFindOption.This method will be removed. UseSharedSessionContract.find(String,Object,FindOption...)instead. SeeFindOption.UseSession.findMultiple(Class,List,FindOption...)instead.UseEntityManager.contains(Object)instead.UseSession.getEntityGraph(Class, String)instead.UseSession.getEntityGraph(String)instead.UseSession.find(Class,Object,FindOption...)instead.This method will be removed. UseSession.find(Class,Object,FindOption...)instead.The semantics of this method may change in a future release.This method will be removed. UseSessionFactory.createGraphForDynamicEntity(String)together withEntityHandler.find(EntityGraph, Object, FindOption...)to load dynamic entities.UseSession.getLobHelper()instead.UseSession.createNamedQuery(String)instead. Retained to allow for forms using Hibernate's legacy result-set building, though such usages should migrate to usingResultSetMapping.This method will be removed. UseEntityManager.lock(Object, LockModeType, LockOption...)insteadThis method will be removed. UseSession.refresh(Object, RefreshOption...)insteadUseSharedSessionContract.getEntityGraph(Class, String)instead.UseSharedSessionContract.getEntityGraph(String)instead.No longer calledWill be removed. Use the other methods to visit each operation.Will be removed. Use the other methods to visit each operation.Transitional interface - useLegacyMutationTargetfor legacy coordinators orGraphMutationTargetfor graph-based decomposersin favor ofScrollableResultsConsumer.instance()UseImmutableObjectArrayMutabilityPlan.get()for object arrays, or implement a dedicated mutability plan for primitive arrays (see for exampleShortPrimitiveArrayJavaType's mutability plan).in favor ofImmutability.instance()in favor ofImmutableMutabilityPlan.instance()This very old approach was never properly implemented in all contexts, and never actually achieved the type safety it aimed for. Just useParameterizedTypefor now.This operation is a layer-breaker. UseUserType.getDefaultSqlLength()This operation is a layer-breaker. UseUserType.getDefaultSqlPrecision()This operation is a layer-breaker. UseUserType.getDefaultSqlScale() - A timeout may be set via
-
Deprecated Packages
-
Deprecated InterfacesInterfaceDescriptionUse settings,
TypeContributor,FunctionContributororAdditionalMappingContributorinstead depending on needPrefer the form of these methods defined onBytecodeLazyAttributeInterceptorinsteadMoved, but still need this definition for ehcacheuseAuditStrategyinstead.UseGeneratedValuesMutationDelegateinstead.seeUUIDGeneratorUse forms ofSession.find(Class, Object)acceptingFindOption} orSession.getReference(Class, Object, KeyType)instead.Consider using discovery instead to dynamically locate contributors.Use theSpecHintsform insteadThis is no longer needed after the introduction ofStateful.Use Session.findMultiple(Class, List, FindOption...) accepting options instead.Use Session.find(Class, Object) or Session.getReference(Class, Object) with KeyType.NATURAL instead.(since 7.3) Use Session.find(Class, Object) with KeyType.NATURAL instead.Transitional interface - useLegacyEntityMutationTargetfor legacy coordinators orGraphEntityMutationTargetfor graph-based decomposersUse Session.find(Class, Object) or Session.getReference(Class, Object) with KeyType.NATURAL instead.SpatialDialects are no longer needed since Hibernate 6.0Will be removed in 6Transitional interface - useLegacyMutationTargetfor legacy coordinators orGraphMutationTargetfor graph-based decomposersThis very old approach was never properly implemented in all contexts, and never actually achieved the type safety it aimed for. Just useParameterizedTypefor now.
-
Deprecated ClassesClassDescriptionUse
SQLServerDialectinstead.No longer useduseDefaultAuditStrategyinstead.useValidityAuditStrategyinstead.sinceUUIDHexGeneratoris deprecatedreplaced byAssignedThis remains around as an implementation detail ofhbm.xmlmappings.useUuidGeneratoruseUuidGeneratorandUuidGeneratorinsteadThis remains around as an implementation detail ofhbm.xmlmappings.Since JPA 3.2 and Hibernate 7, aLockMode,Timeout, orPessimisticLockScopemay be passed directly as an option tofind(),refresh(), orlock(). Therefore, this class is obsolete as an API and will be moved to an SPI package.For HQL/JPQL queries, locking should be controlled via operations of the
SelectionQueryinterface:- A timeout may be set via
CommonQueryContract.setTimeout(Timeout) - The
PessimisticLockScopemay be set usingSelectionQuery.setLockScope(PessimisticLockScope) - Use of follow-on locking may be enabled via
SelectionQuery.setFollowOnStrategy(Locking.FollowOn)
Timeoutsprovides several operations to simplify migration.Spatial Dialects are no longer needed. Use the standard CockroachDB dialectsSpatial dialects are no longer neededUse "hibernate.dialect.storage_engine=innodb" environment variable or JVM system property instead.Spatial Dialects are no longer neededUse "hibernate.dialect.storage_engine=innodb" environment variable or JVM system property instead.Spatial Dialects are no longer neededSpatialDialects are no longer needed in Hibernate 6A SpatialDialect is no longer required. Use the standard Dialect for this database.A SpatialDialect is no longer required. Use the standard Dialect for this database.A SpatialDialect is no longer required. Use the standard Dialect for this database.A SpatialDialect is no longer required. Use the standard Dialect for this database.A SpatialDialect is no longer required. Use the standard Dialect for this database.A SpatialDialect is no longer required. Use the standard Dialect for this database.UseGeolatteSpatialCriteriaBuilderinsteadUseGeolatteSpatialCriteriaBuilderinsteadUseJTSSpatialCriteriaBuilderinsteadUseImmutableObjectArrayMutabilityPlan.get()for object arrays, or implement a dedicated mutability plan for primitive arrays (see for exampleShortPrimitiveArrayJavaType's mutability plan).This kind of mapping is no longer required by the JPA specification. It makes more sense to usebyte[]to representVARBINARY.This kind of mapping is no longer required by the JPA specification. It makes more sense to usechar[]orStringto representVARCHAR.useFloatJdbcType - A timeout may be set via
-
Deprecated Enum ClassesEnum ClassDescriptionNo longer usedAll dialects currently use
TempTableDdlTransactionHandling.NONE, so it's obsolete.This enum still has exactly one member, and was placed in a package from which it has no usages. It will be removed or moved.This enumeration will be removed, and replaced with a simpler boolean-valued switch.To be replaced byCommonSpatialFunction
-
Deprecated Exception ClassesException ClassDescriptionMethods of
Interceptorare no longer required to throw this exception type.
-
Deprecated Record ClassesRecord ClassDescriptionSince hbm.xml support will go away
-
Deprecated Annotation InterfacesAnnotation InterfaceDescriptionsince
Checkis deprecated.UseColumn.secondPrecision()which was introduced in JPA 3.2
-
Deprecated FieldsFieldDescriptionUse
AvailableSettings.JAKARTA_LOCK_SCOPEinsteadUseAvailableSettings.JAKARTA_LOCK_TIMEOUTinsteadUseBatchSettings.BUILDERinsteadWill 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-17643Will be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-15641this is only honored forhibernate-infinispanUseCacheSettings.JAKARTA_SHARED_CACHE_MODEinsteadUseCacheSettings.JAKARTA_SHARED_CACHE_RETRIEVE_MODEinsteadUseCacheSettings.JAKARTA_SHARED_CACHE_STORE_MODEinsteadThis setting is only supported byC3P0ConnectionProviderandDriverManagerConnectionProvider.The JPA-standard "jakarta.persistence.jtaDataSource" or "jakarta.persistence.nonJtaDataSource" setting are now preferred.UseJdbcSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSIONinsteadUseJdbcSettings.JAKARTA_HBM2DDL_DB_MINOR_VERSIONinsteadUseJdbcSettings.JAKARTA_HBM2DDL_DB_NAMEinsteadUseJdbcSettings.JAKARTA_HBM2DDL_DB_VERSIONinsteadThe JPA-standard settingJdbcSettings.JAKARTA_JDBC_DRIVERis now preferred.UseJdbcSettings.JAKARTA_HBM2DDL_CONNECTIONinsteadUseJdbcSettings.JAKARTA_JDBC_DRIVERinsteadUseJdbcSettings.JAKARTA_JDBC_PASSWORDinsteadUseJdbcSettings.JAKARTA_JDBC_URLinsteadUseJdbcSettings.JAKARTA_JDBC_USERinsteadUseJdbcSettings.JAKARTA_JTA_DATASOURCEinsteadUseJdbcSettings.JAKARTA_NON_JTA_DATASOURCEinsteadThe JPA-standard settingJdbcSettings.JAKARTA_JDBC_PASSWORDis now preferred.The JPA-standard settingJdbcSettings.JAKARTA_JDBC_URLis now preferred.It's not necessary to set this explicitlyThe JPA-standard settingJdbcSettings.JAKARTA_JDBC_USERis now preferred.No longer has any effect. Since 7.0 (and removal of save/update processing), Hibernate always cascades PERSISTUseManagedBeanSettings.JAKARTA_CDI_BEAN_MANAGERinsteadUsePersistenceSettings.JAKARTA_PERSISTENCE_PROVIDERinsteadUsePersistenceSettings.JAKARTA_TRANSACTION_TYPEinsteadUseGlobalTemporaryTableStrategy.CREATE_ID_TABLES.UseGlobalTemporaryTableStrategy.DROP_ID_TABLES.UseLocalTemporaryTableStrategy.DROP_ID_TABLES.UsePersistentTableStrategy.CREATE_ID_TABLES.UsePersistentTableStrategy.DROP_ID_TABLES.The JPA-standard settingSchemaToolingSettings.JAKARTA_HBM2DDL_CREATE_SCHEMASis now preferred.Migrate toSchemaToolingSettings.JAKARTA_HBM2DDL_CREATE_SOURCEinsteadThe JPA-standard settingSchemaToolingSettings.JAKARTA_HBM2DDL_LOAD_SCRIPT_SOURCEis now preferred.UseValidationSettings.JAKARTA_VALIDATION_FACTORYinsteadUseValidationSettings.JAKARTA_VALIDATION_MODEinsteadUsePersistentBag.bagAsList()orPersistentBag.collectioninstead.becauseorg.hibernate.annotations.CascadeType#LOCKwas removedbecauseorg.hibernate.annotations.CascadeType#LOCKwas removedUseGraphLanguageLexer.VOCABULARYinstead.UseGraphLanguageParser.VOCABULARYinstead.UseLegacyGraphLanguageParser.VOCABULARYinstead.UseSqlScriptLexer.VOCABULARYinstead.UseSqlScriptParser.VOCABULARYinstead.UseOrderingLexer.VOCABULARYinstead.UseOrderingParser.VOCABULARYinstead.This is not an elegant way to do anythingno longer set, useJdbcEnvironment.getIdentifierHelper()Use discovery instead.Consider using discovery instead to dynamically locate contributors.Use HibernateHints.HINT_FOLLOW_ON_STRATEGY instead to allow an additional option to ignore follow-on locking which will potentially skip locking some rows but may be useful for applications targeting multiple databases.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.This, and the other constants on this class, will be removed.this feature of HQL is now deprecatedin favor ofScrollableResultsConsumer.instance()in favor ofImmutability.instance()in favor ofImmutableMutabilityPlan.instance()
-
Deprecated MethodsMethodDescriptionThis method is not used by
GraphBasedActionQueueand is only needed forActionQueueLegacy. It will be removed when the legacy implementation is removed.This method is not used byGraphBasedActionQueueand is only needed forActionQueueLegacy. It will be removed when the legacy implementation is removed.This method is not used byGraphBasedActionQueueand is only needed forActionQueueLegacy. It will be removed when the legacy implementation is removed.Set thehibernate-modelssettinghibernate.models.jandex.indexinstead. This method has no effect.UseIdentifier.quoted().See discussion ofTypeContributorin User Guide.UseTypeContributions.contributeType(BasicType)instead.UseTypeContributions.contributeType(BasicType)instead.Use NamedStrategyContributor insteadUse NamedStrategyContributor insteadhbm.xmlmapping file support is deprecated. Use extended orm.xml bindings instead.Set via thehibernate-modelssettinghibernate.models.jandex.indexinsteadNo longer supportedUse BootstrapContext.getModelsContext() instead.Will be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-19660Use EnhancementOptions.doDirtyCheckingInline() instead.Will be removed without replacement. See HHH-19661Use EnhancementOptions.doExtendedEnhancement() instead.UseBytecodeProvider.getReflectionOptimizer(Class, Map)inssteadonly because it's currently never calledNo longer calledIn dialect implementations, preferDatabaseVersion.makeCopyOrDefault(DatabaseVersion)to gracefully default to the minimum supported version.In dialect implementations, preferDatabaseVersion.makeCopyOrDefault(DatabaseVersion)to gracefully default to the minimum supported version.useDialect.getCheckCondition(String, Long[])insteadSince Hibernate now baselines on Java 17,Connection.getSchema()is always available directly. Never used internally.No longer usedUse Dialect.getForUpdateString(LockMode,Timeout) insteadNo longer usedUse Dialect.getNativeValueGenerationStrategy() insteadOverride the methodrenderInsertIntoNoColumns()on thetranslatorreturned by this dialect.Use LockingSupport.Metadata.getPessimisticLockStyle() instead. Here, fwiw, we use 1-second to make the determination.Use Dialect.getReadLockString(Timeout) instead.Use Dialect.getReadLockString(String, Timeout) instead.Use LockingSupport.Metadata.getReadRowLockStrategy(), via Dialect.getLockingSupport(), instead.No dialect currently overrides this, so it's obsoleteUse Timeouts.getTimeoutInSeconds(int) instead.Use Dialect.getWriteLockString(Timeout) instead.Use Dialect.getWriteLockString(String, Timeout) instead.Use LockingSupport.Metadata.getWriteRowLockStrategy(), via Dialect.getLockingSupport(), instead.See notes on LockingSupport.Metadata.supportsForUpdate()Use LockingSupport.Metadata.getPessimisticLockStyle(), via Dialect.getLockingSupport(), instead.See notes on LockingSupport.Metadata.supportsNoWait()Use LockingSupport.Metadata.getOuterJoinLockingType() instead, via Dialect.getLockingSupport().See notes on LockingSupport.Metadata.supportsSkipLocked()UseDialect.getLocalTemporaryTableStrategy()andDialect.getGlobalTemporaryTableStrategy()to check insteadSee notes on LockingSupport.Metadata.supportsWait()Use LockingSupport.Metadata.getPessimisticLockStyle(), passing the necessary lock timeout instead.Use LockingSupport.Metadata.getPessimisticLockStyle(), with Timeouts.NO_WAIT instead.Use LockingSupport.Metadata.getPessimisticLockStyle(), with Timeouts.SKIP_LOCKED instead.Use LockingSupport.Metadata.getPessimisticLockStyle(), with a real timeout value instead.UseConfigurationService.getSetting(String, Converter, Object). This method does not report errors correctly.Use a providedSqlStringGenerationContextinstead.Used by the mutation handling from the legacy action queue. It is not needed for the graph-based queue.No longer called. Will be removed.this method should be removed; alternative methods are available that better express the intent, allowing for better optimisations. Not aggressively removing this as it's an SPI, but also useful for testing and other contexts which are not performance sensitive. N.B. This might return an immutable map: do not use for mutations!No longer usedJust as the method it overrides. Interceptors that deal with lazy state should implementBytecodeLazyAttributeInterceptorJust as the method it overrides. Interceptors that deal with lazy state should implementBytecodeLazyAttributeInterceptorInterceptors that deal with * lazy state should implementBytecodeLazyAttributeInterceptorThis was only used in tests and can be quite safely removed. UseEventSource.getActionQueue().Use@AuditOverride(forClass=SomeEntity.class)instead.useRevisionListenerinstead. While this method is being deprecated, expect a new API for this in 6.0.UseEventListenerGroup.clearListeners()instead, which doesn't also reset the registeredDuplicationStrategys.this is not the most efficient way for iterating the event listeners. SeeEventListenerGroup.fireEventOnEachListener(Object, BiConsumer)and its overloaded variants for better alternatives.Use LoadEvent.getLockOptions() instead.Use LoadEvent.getLockOptions() instead.Use LoadEvent.getLockOptions() instead.Use LockEvent.getLockOptions() instead.Use LockEvent.getLockOptions() instead.Use LockEvent.getLockOptions() instead.Use RefreshEvent.getLockOptions() instead.Use RefreshEvent.getLockOptions() instead.Use RefreshEvent.getLockOptions() instead.There is no plan to remove this operation, but its use should be avoided sinceFilterDefinitionis an SPI type, and so this operation is a layer-breaker.Since it is not type safe and returns a raw typeSince it is not type safe, returns a raw type, and accepts a stringSince it is not type safe and returns a raw typeSince it accepts a string instead ofGraphSemanticExposed for tests only.UseDatabaseStructure.configure(Optimizer)instead.Exposed for tests only.since it overrides a deprecated methodExposed for tests only.Use Session.getReference(Class, Object, KeyType) instead.Use MultiIdLoadOptions.getSessionCheckMode() instead.Use MultiLoadOptions.getOrderingMode() instead.Use MultiLoadOptions.getRemovalsMode() instead.(since 7.3) : useNaturalIdLoader.load(Object, Options, SharedSessionContractImplementor)instead.With no replacement; LockOptions is no longer considered an API.LockOptions will be made into a record.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Alias-specific locks are no longer supported, roughly replaced with locking scope.Use LockOptions.getFollowOnStrategy() instead.Use LockOptions.getScope() insteadAlias-specific locks are no longer supported, roughly replaced with locking scope.LockOptions will be made into a record.LockOptions will be made into a record.LockOptions will be made into a record.Alias-specific locks are no longer supported, roughly replaced with locking scope.Use LockOptions.setFollowOnStrategy(Locking.FollowOn) instead.Use LockOptions.setScope(PessimisticLockScope) insteadNo longer supportednew read-by-position paradigm means that these generated aliases are no longer needednew read-by-position paradigm means that these generated aliases are no longer neededUseTable.addInitCommand(Function)instead.Should build aQualifiedTableNamethen useSqlStringGenerationContext.format(QualifiedTableName).Use Session.getReference(Class, Object, KeyType) instead, with KeyType.NATURAL as an option.Use one of Session.find(Class, Object, FindOption...), SharedSessionContract.find(String, Object, FindOption...), or EntityHandler.find(EntityGraph, Object, FindOption...) instead with KeyType.NATURAL as an option.Hibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here (generally),PluralAttributeMappingRead-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getElementDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getIdentifierDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getIndexDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Corresponding mapping metamodel calls should be used instead - here,PluralAttributeMapping.getKeyDescriptor()by the supertypesorg.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyColumnAliases(int, String) Hibernate no longer uses aliases to read from result setsHibernate no longer uses aliases to read from result setsThis feature is no longer supportedUseSelectableMapping.getSelectionExpression()insteadUseEntityPersister.getValue(Object, int)insteadUseEntityPersister.getValues(Object)insteadOnly ever used from places where we really want to useSelectStatement(select generator)InsertSelectStatementUpdateStatementDeleteStatement
UseEntityPersister.canReadFromCache()and/orEntityPersister.canWriteToCache()depending on needUseEntityPersister.setValue(Object, int, Object)insteadUseEntityPersister.setValues(Object, Object[])insteadNo longer used in ORM coreUsed by legacy action queue processes.useLegacyEntityMutationTarget.getInsertDelegate()insteadsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedPrefer HibernateCriteriaBuilder.and(BooleanExpression...) instead. This method used to be defined as part of Jakarta Persistence, which removed it as of 4.0.Prefer HibernateCriteriaBuilder.or(BooleanExpression...) instead. This method used to be defined as part of Jakarta Persistence, which removed it as of 4.0.UseJpaCteContainer.with(String, AbstractQuery)and provide an explicit name for the CTEorg.hibernate.query.MutationOrSelectionQuery.setResultListTransformer(ResultListTransformer<Object>) UseMutationQuery.execute()instead.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use ResultSetMapping, or similar approach pending the outcome of this Jakarta Persistence request.Use MutationQuery instead for queries which mutate data.Use SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as second-level cache interaction is only relevant for queries which return results.Use SelectionQuery instead as second-level cache interaction is only relevant for queries which return results.Use SelectionQuery instead as fetch size is only relevant for selection queriesUse SelectionQuery instead as applying result limits is only relevant for queries which return results.Use SelectionQuery instead as locking is only relevant for queries which return results.Use SelectionQuery instead as locking is only relevant for queries which return results.Use SelectionQuery instead as applying result limits is only relevant for queries which return results.The variousQuery<T>subtypes already expose all relevant options; furthermore, this operation is a layer-breaker, exposing theQueryOptionsSPI type via an API.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as read-only mode is only relevant for selection queriesUse SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as caching is only relevant for selection queriesUse SelectionQuery instead as second-level cache interaction is only relevant for queries which return results.Use SelectionQuery instead as second-level cache interaction is only relevant for queries which return results.Prefer passing the entity-graph while creating the query - SharedSessionContract.createSelectionQuery(String, EntityGraph)Use SelectionQuery instead as fetch size is only relevant for selection queriesUse SelectionQuery instead as applying result limits is only relevant for queries which return results.Use Query.setQueryFlushMode(QueryFlushMode) instead.Use SelectionQuery instead as locking is only relevant for queries which return results.Use SelectionQuery instead as locking is only relevant for queries which return results.Use SelectionQuery instead as locking is only relevant for queries which return results.Use SelectionQuery instead as applying result limits is only relevant for queries which return results.Use SelectionQuery instead as read-only mode is only relevant for selection queriesUse SelectionQuery instead as result list transformation is only relevant for queries which return results.Use SelectionQuery instead as tuple transformation is only relevant for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Use SelectionQuery instead for queries which return results.Prefer passing the entity-graph while creating the query - SharedSessionContract.createSelectionQuery(String, EntityGraph)Prefer passing the entity-graph while creating the query - SharedSessionContract.createSelectionQuery(String, EntityGraph)SinceImmutableEntityUpdateQueryHandlingModeis deprecated. UseQueryEngineOptions.allowImmutableEntityUpdate()instead.org.hibernate.query.sql.spi.NativeQueryImplementor.setParameter(Parameter<Date>, Date, TemporalType) ImplementArgumentsValidator.validate(List, String, BindingContext)insteadThis method returns a globally-unique alias which introduces a temporal dependence in the query interpretation process, leading to misses on the query interpretation cache. Aliases only need to be unique in the scope of a given query, and so alias generation should be contextual to the query.When the argument is null, this method returns a globally-unique alias which introduces a temporal dependence in the query interpretation process, leading to misses on the query interpretation cache.useTypedParameterValue.typeuseTypedParameterValue.typeuseTypedParameterValue.valueUseSchemaManager.drop(boolean)instead.UseSchemaManager.create(boolean)instead.UseSchemaManager.truncate()instead.UseSchemaManager.validate()instead.This method will be removed. UseSession.find(Class,Object,FindOption...)instead. SeeFindOption.This method will be removed. UseSharedSessionContract.find(String,Object,FindOption...)instead. SeeFindOption.UseSession.findMultiple(Class,List,FindOption...)instead.Use Session.findMultiple(Class, List, FindOption...) withKeyType.NATURALinstead.Use Session.findMultiple(Class, List, FindOption...) withKeyType.NATURALinstead.Use Session.find(Class, Object) withKeyType.NATURALinstead.Use Session.find(Class, Object) withKeyType.NATURALinstead.Use Session.find(Class, Object) withKeyType.NATURALinstead.Use Session.find(Class, Object) withKeyType.NATURALinstead.UseEntityManager.contains(Object)instead.UseSession.getEntityGraph(Class, String)instead.UseSession.getEntityGraph(String)instead.UseSession.find(Class,Object,FindOption...)instead.This method will be removed. UseSession.find(Class,Object,FindOption...)instead.The semantics of this method may change in a future release.This method will be removed. UseSessionFactory.createGraphForDynamicEntity(String)together withEntityHandler.find(EntityGraph, Object, FindOption...)to load dynamic entities.UseSession.getLobHelper()instead.UseSession.createNamedQuery(String)instead. Retained to allow for forms using Hibernate's legacy result-set building, though such usages should migrate to usingResultSetMapping.This method will be removed. UseEntityManager.lock(Object, LockModeType, LockOption...)insteadThis method will be removed. UseSession.refresh(Object, RefreshOption...)insteadThis operation exposes the SPI typePhysicalConnectionHandlingModeand is therefore a layer-breaker. UseSessionBuilder.connectionHandling(ConnectionAcquisitionMode, ConnectionReleaseMode)instead.This operation exposes the SPI typeStatementInspectorand is therefore a layer-breaker. UseSessionBuilder.statementInspector(UnaryOperator)instead.There is no plan to remove this operation, but its use should be avoided sinceFilterDefinitionis an SPI type, and so this operation is a layer-breaker.There is no plan to remove this operation, but its use should be avoided sinceSessionFactoryOptionsis an SPI type, and so this operation is a layer-breaker.UseSharedSessionContract.getEntityGraph(Class, String)instead.UseSharedSessionContract.getEntityGraph(String)instead.Use Session.getReference(Class, Object, KeyType) instead, with KeyType.NATURAL as an option.Use one of Session.find(Class, Object, FindOption...), SharedSessionContract.find(String, Object, FindOption...), or EntityHandler.find(EntityGraph, Object, FindOption...) instead with KeyType.NATURAL as an option.No longer calledorg.hibernate.sql.model.ast.builder.AssigningTableMutationBuilder.addValueColumn(ColumnValueBinding) Will be removed. Use the other methods to visit each operation.Will be removed. Use the other methods to visit each operation.This operation exposes the SPI typeStatementInspectorand is therefore a layer-breaker. UseStatelessSessionBuilder.statementInspector(UnaryOperator)instead.not appropriate for named enum or array typesThis operation is not very typesafe, and we're migrating away from its useThis simply isn't a very sensible place to hang theServiceRegistryThis operation is not very typesafe, and we're migrating away from its useThis operation is a layer-breaker. UseUserType.getDefaultSqlLength()This operation is a layer-breaker. UseUserType.getDefaultSqlPrecision()This operation is a layer-breaker. UseUserType.getDefaultSqlScale()
-
Deprecated ConstructorsConstructorDescriptionUse LockEvent(Object, LockOptions, EventSource) instead.Use LockEvent(String, Object, LockOptions, EventSource) instead.use
RefreshEvent(Object, LockOptions, EventSource)instead.Use LockOptions(LockMode, Timeout) insteadthis constructor does not carry information about the query which caused the failurethis constructor does not carry information about the query which caused the failurethis constructor does not carry information about the query which caused the failurewas previously used for HQL. UseSqmUpdateStatement(NodeBuilder)insteadwas previously used for Criteria. UseSqmUpdateStatement(Class, SqmCriteriaNodeBuilder)instead.this constructor does not carry information about the query which caused the failurethis constructor does not carry information about the query which caused the failurethis constructor does not carry information about the query which caused the failure
-
Deprecated Enum ConstantsEnum ConstantDescriptionThe influence of Jakarta Validation constraints on DDL schema generation is now enabled by default when the validation mode is
ValidationMode.AUTO. Use the setting "hibernate.tooling.schema.apply_validation_constraints" to control this behavior instead. To require that a Jakarta Validation provider is available (as this mode did), useREQUIRED.
-
Deprecated Annotation Interface ElementsAnnotation Interface ElementDescriptionUse
@AuditOverride(forClass=SomeEntity.class)instead.