Deprecated API
Contents
- Terminally Deprecated ElementsElementDescriptionUse the JPA-defined
CascadeTypeUse the JPA-definedCascadeType. This enumeration will be removed to alleviate the duplication in naming.UseQueryFlushMode. This enumeration will be removed to alleviate the duplication in naming withFlushModeType.UseColumn.secondPrecision()which was introduced in JPA 3.2Use the new approach based onIdGeneratorType.useGenericGenerator.type()for typesafetysinceGenericGeneratoris deprecated.Use anExpectationclass instead.useCurrentTimestampinsteaduseSQLDelete.verify()with anExpectationclassuseSQLDeleteAll.verify()with anExpectationclassuseSQLInsert.verify()with anExpectationclassuseSQLUpdate.verify()with anExpectationclassJust implementSessionEventListenerdirectly.No longer usedInternal code should use the internal implementation classTypeDefinitionRegistryStandardImpl. This class will be removed.UseNamedStrategyContributor insteadUseNamedStrategyContributor insteadThis enumeration is currently unused and will be removed. UseActioninstead.This has no effect and will be removed.No longer has any effect.since"hibernate.discard_pc_on_close" is deprecatedwith no replacement.Use settings,TypeContributor,FunctionContributororAdditionalMappingContributorinstead depending on needno longer calledwith no replacement.This operation is a layer-breaker, exposing an internal type. It will be removed. UseSessionFactoryOptions.buildSessionEventListeners()instead.This is unused and will be removed.with no replacement.This is no longer usedsince"hibernate.discard_pc_on_close" is deprecatedWill be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-15641Register aBytecodeProviderthrough Javaservices.This setting no longer has any effect.This is no longer useful and will be removed.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-17643Will be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-15641It's not necessary to set this explicitlyThis setting is now ignored. Enable the log categoryorg.hibernate.session.metricsto automatically collect and log session-level metrics.UsePersistentBag.bagAsList()orPersistentBag.collectioninstead.useDialect.getCheckCondition(String, Long[])insteadUseDialect.getNativeValueGenerationStrategy() insteadMoved toDialectMoved toDialectin favor ofSize(Integer, Integer, Long)in favor ofSize(Integer, Integer, Long)UseSchemaNameResolver instead.This class is no longer used and will be removedbecauseCascadeType.LOCKis deprecatedNo longer usedUse anExpectationclassOnly used in one place, will be removedNo longer useful, since Java made downcasting saferNo longer useful, since Java made downcasting saferNo longer used, replaced bySharedSessionContractImplementor.instantiate(EntityPersister, Object)No longer useful, since Java made downcasting saferNo longer useful, since Java made downcasting saferThis is no longer neededRenamedEventMonitor.RenamedDiagnosticEvent.Graph.addElementSubgraph(PluralAttribute)was added in JPA 3.2, and so this method is no longer neededThis will be removedThis will be removedPlanned for removal in JPA 4Subclasses should now directly inheritPostInsertIdentifierGeneratorandBulkInsertionCapableIdentifierGenerator, or even better, simply implementOnExecutionGeneratordirectly.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()This class is no longer needed and will be removed.use the default constructor insteaduseStandardStack(Object)instead.No longer usedNo longer usedNo longer usedNo longer usedNo longer usedNo longer usedUsediscovery instead.Consider usingdiscovery instead to dynamically locatecontributors.sincePersistenceUnitTransactionTypewill be removed in JPA 4Consider usingdiscovery instead to dynamically locatecontributors.As LockOptions will become an SPI, this method will be removed with no replacementSince 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) - Alias-specific lock modes may be specified using
SelectionQuery.setLockMode(String, LockMode) - Use of follow-on locking may be enabled via
SelectionQuery.setFollowOnLocking(boolean)
Timeoutsprovides several operations to simplify migration.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.No longer called, except from tests. UseKeyValue.createGenerator(Dialect, RootClass, Property, GeneratorSettings)No longer supportedbecauseTable.ForeignKeyKeyshould be private.UseDiscriminable.getDiscriminatorMapping()instead.No longer usedHigly inefficient - do not use; this exists to support other deprecated methods and will be removed.Only called from testsOnly called from testsNo longer calledNo longer calledHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here (generally),PluralAttributeMappingRead-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getElementDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getIdentifierDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getIndexDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getKeyDescriptor()The functionality of DiscriminatorMetadata,DiscriminatorTypeandMetaTypehave been consolidated intoEntityDiscriminatorMappingandDiscriminatorConverterThe functionality of DiscriminatorType,DiscriminatorMetadataandMetaTypehave been consolidated intoEntityDiscriminatorMappingandDiscriminatorConverterNo longer usedNo longer calledSinceDiscriminatorMetadatais deprecatedNo longer used in ORM coreuseEntityMutationTarget.getInsertDelegate()insteadNo longer used.org.hibernate.query.criteria.HibernateCriteriaBuilder.arrayContainsAllNullable(Expression<T[]>, T[]) org.hibernate.query.criteria.HibernateCriteriaBuilder.arrayContainsAllNullable(T[], Expression<T[]>) This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(Subquery, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(Subquery, org.hibernate.query.common.JoinType, boolean)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(Class, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(EntityDomainType, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(JpaCteCriteria, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.joinLateral(Subquery, org.hibernate.query.common.JoinType)No longer calledSinceLockOptionsis transitioning to a new role as an SPI.SinceLockOptionsis transitioning to a new role as an SPI.This enumeration will be removed, and replaced with a simpler boolean-valued switch.SinceImmutableEntityUpdateQueryHandlingModeis deprecated. UseQueryEngineOptions.allowImmutableEntityUpdate()instead.UseQueryParameterBindings.empty()instead. Currently unused and can be safely removed.This interface is no longer needed and will be removed.this constructor does not carry information about the query which caused the failureThis enum still has exactly one member, and was placed in a package from which it has no usages. It will be removed or moved.ImplementArgumentsValidator.validate(List, String, BindingContext)insteadwas previously used for HQL. UseSqmUpdateStatement(NodeBuilder)insteadwas previously used for Criteria. UseSqmUpdateStatement(Class, SqmCriteriaNodeBuilder)instead.Because the semantics of this method may change in a future release. UseSession.find(Class, Object)instead.UseEntityManager.find(Class, Object, FindOption...)instead.This method will be removed. UseEntityManager.find(Class, Object, FindOption...)instead.The semantics of this method may change in a future release. UseSessionFactory.createGraphForDynamicEntity(String)together withEntityManager.find(EntityGraph, Object, FindOption...)to loaddynamic entities.The semantics of this method may change in a future release.This method will be removed. UseSessionFactory.createGraphForDynamicEntity(String)together withEntityManager.find(EntityGraph, Object, FindOption...)to loaddynamic entities.This method will be removed. UseEntityManager.lock(Object, LockModeType, LockOption...) insteadThis method will be removed. UseEntityManager.refresh(Object, RefreshOption...) insteadUseSessionBuilder.tenantIdentifier(Object)insteadNo longer calledWill be removed. Use the other methods to visit each operation.Will be removed. Use the other methods to visit each operation.The existence of this method encourages people to pass around references to the SessionFactoryImplementor when they don't need itin favor ofScrollableResultsConsumer.instance()No direct replacement.No direct replacement.Replaced byAttributeMappingNo direct replacement, though seeAttributeMappingandAttributeMetadataNo direct replacementNo direct replacementNo direct replacementNo direct replacementNo direct replacementReplaced byEntityMappingType. EntityMetamodel was a first attempt at what has becomeEntityMappingTypeReplaced byEntityVersionMappingReplaced byEventTypeas id-generation has been redefined using the new broadergeneration approach. For 7.0, this is kept around to supporthbm.xmlmappings and will be removed in 8.0 once we finally drophbm.xmlsupport.No direct replacement; seeEntityIdentifierMappingNo direct replacement; seeEntityIdentifierMappingNo direct replacementNo direct replacementReplaced byAttributeMappingin favor ofImmutability.instance()in favor ofImmutableMutabilityPlan.instance()UseH2JsonJdbcTypeinsteadNo longer usedIs not called anymoreThis very old approach was never properly implemented in all contexts, and never actually achieved the type safety it aimed for. Just useParameterizedTypefor now. - 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 ehcacheMoved toDialectUseSchemaNameResolver instead.No longer usedThis is no longer neededuseAuditStrategyinstead.This is no longer implemented by any listenerRenamedEventMonitor.RenamedDiagnosticEvent.sinceSession.replicate(java.lang.Object, org.hibernate.ReplicationMode)is deprecatedUseGeneratedValuesMutationDelegateinstead.Consider usingdiscovery instead to dynamically locatecontributors.Use theSpecHintsform insteadThe functionality of DiscriminatorMetadata,DiscriminatorTypeandMetaTypehave been consolidated intoEntityDiscriminatorMappingandDiscriminatorConverterThis interface is no longer needed and will be removed.SpatialDialects are no longer needed since Hibernate 6.0Will be removed in 6UseTupleTransformerand/orResultListTransformerinsteadReplaced byAttributeMappingNo direct replacement; seeEntityIdentifierMappingNo direct replacementThis very old approach was never properly implemented in all contexts, and never actually achieved the type safety it aimed for. Just useParameterizedTypefor now.
- Deprecated ClassesClassDescriptionJust implement
SessionEventListenerdirectly.Internal code should use the internal implementation classTypeDefinitionRegistryStandardImpl. This class will be removed.Moved toDialectThis class is no longer used and will be removeduseDefaultAuditStrategyinstead.useValidityAuditStrategyinstead.sinceSession.replicate(java.lang.Object, org.hibernate.ReplicationMode)is deprecatedbecause bothSourceandhbm.xmlare deprecated, though this implementation is instructiveSubclasses should now directly inheritPostInsertIdentifierGeneratorandBulkInsertionCapableIdentifierGenerator, or even better, simply implementOnExecutionGeneratordirectly.sinceUUIDHexGeneratoris deprecatedreplaced byAssignedThis remains around as an implementation detail ofhbm.xmlmappings.useUuidGeneratorandUuidGeneratorinsteadThis remains around as an implementation detail ofhbm.xmlmappings.This class is no longer needed and will be removed.UseClassLoaderServiceinsteadThis is a legacy of very ancient versions of Hibernate.Hibernate now uses StAX for XML processing and the role of this class is served now byLocalXmlResourceResolverThe JPA specification does not require that we allow entity lifecycle callbacks on embeddable classes, and this is a misfeature since:- an embeddable objects doesn't have a well-defined lifecycle,
- it's difficult to understand what this means for composite collection elements, and
- currently, the
PreUpdate/PostUpdatecallbacks get called when the embeddable object is not itself being updated.
UseAvailableHintsinsteadSince 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) - Alias-specific lock modes may be specified using
SelectionQuery.setLockMode(String, LockMode) - Use of follow-on locking may be enabled via
SelectionQuery.setFollowOnLocking(boolean)
Timeoutsprovides several operations to simplify migration.Please get rid of it: such collections should be immutable.The functionality of DiscriminatorType,DiscriminatorMetadataandMetaTypehave been consolidated intoEntityDiscriminatorMappingandDiscriminatorConverterSpatial 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.UseGeolatteSpatialCriteriaBuilderinsteadUseGeolatteSpatialCriteriaBuilderinsteadUseJTSSpatialCriteriaBuilderinsteadsinceResultTransformeris deprecatedsinceResultTransformeris deprecatedsinceResultTransformeris deprecatedsinceResultTransformeris deprecatedsinceResultTransformeris deprecatedNo direct replacement.No direct replacement.No direct replacement, though seeAttributeMappingandAttributeMetadataNo direct replacementNo direct replacementNo direct replacementNo direct replacementNo direct replacementReplaced byEntityMappingType. EntityMetamodel was a first attempt at what has becomeEntityMappingTypeReplaced byEntityVersionMappingNo direct replacement; seeEntityIdentifierMappingNo direct replacementReplaced byAttributeMappingUseImmutableObjectArrayMutabilityPlan.get()for object arrays, or implement a dedicated mutability plan for primitive arrays (see for exampleShortPrimitiveArrayJavaType's mutability plan).UseH2JsonJdbcTypeinstead
- Deprecated Enum ClassesEnum ClassDescriptionUse the JPA-defined
CascadeType. This enumeration will be removed to alleviate the duplication in naming.UseQueryFlushMode. This enumeration will be removed to alleviate the duplication in naming withFlushModeType.Use anExpectationclass instead.This enumeration is currently unused and will be removed. UseActioninstead.All dialects currently useTempTableDdlTransactionHandling.NONE, so it's obsolete.Use anExpectationclassUse Jakarta PersistenceNulls instead.This enumeration will be removed, and replaced with a simpler boolean-valued switch.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.sinceSession.replicate(Object, ReplicationMode)is deprecatedTo be replaced byCommonSpatialFunctionReplaced byEventTypeas id-generation has been redefined using the new broadergeneration approach. For 7.0, this is kept around to supporthbm.xmlmappings and will be removed in 8.0 once we finally drophbm.xmlsupport.
- Deprecated ExceptionsExceptionsDescriptionIt would be nice to be able to eliminate this completelyMethods of
Interceptorare no longer required to throw this exception type.
- Deprecated Annotation InterfacesAnnotation InterfaceDescriptionUse the JPA-defined
CascadeTypesinceCheckis deprecated.PreferTable.comment(),Column.comment(), etc.PerComment, preferTable.comment()UseColumn.secondPrecision()which was introduced in JPA 3.2Use the new approach based onIdGeneratorType.sinceGenericGeneratoris deprecated.useCurrentTimestampinstead
- Deprecated FieldsFieldDescriptionRegister a
BytecodeProviderthrough Javaservices.This setting no longer has any effect.This is no longer useful and will be removed.UseAvailableSettings.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_MODEinsteadThis setting is only supported byC3P0ConnectionProviderandDriverManagerConnectionProviderImpl.The JPA-standard"jakarta.persistence.jtaDataSource" or"jakarta.persistence.nonJtaDataSource" setting are now preferred.UseJdbcSettings.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 cascadesPERSISTUseManagedBeanSettings.JAKARTA_CDI_BEAN_MANAGERinsteadUsePersistenceSettings.JAKARTA_TRANSACTION_TYPEinsteadthis setting is not currently usedThe 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.This setting is now ignored. Enable the log categoryorg.hibernate.session.metricsto automatically collect and log session-level metrics.UseValidationSettings.JAKARTA_VALIDATION_MODEinsteadUsePersistentBag.bagAsList()orPersistentBag.collectioninstead.becauseCascadeType.LOCKis deprecatedUseGraphLanguageLexer.VOCABULARYinstead.UseGraphLanguageParser.VOCABULARYinstead.UseHqlLexer.VOCABULARYinstead.UseHqlParser.VOCABULARYinstead.UseSqlScriptLexer.VOCABULARYinstead.UseSqlScriptParser.VOCABULARYinstead.UseOrderingLexer.VOCABULARYinstead.UseOrderingParser.VOCABULARYinstead.This is not an elegant way to do anythingno longer set, useJdbcEnvironment.getIdentifierHelper()Usediscovery instead.Consider usingdiscovery instead to dynamically locatecontributors.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 deprecatedUseQueryParameterBindings.empty()instead. Currently unused and can be safely removed.in favor ofScrollableResultsConsumer.instance()in favor ofImmutability.instance()in favor ofImmutableMutabilityPlan.instance()
- Deprecated MethodsMethodDescriptionuse
GenericGenerator.type()for typesafetyuseSQLDelete.verify()with anExpectationclassuseSQLDeleteAll.verify()with anExpectationclassuseSQLInsert.verify()with anExpectationclassuseSQLUpdate.verify()with anExpectationclass(since 7.0) Not used; no replacement.With move to unified schema, this setting is now deprecated and will be removed once support for readinghbm.xmlfiles is fully removed.Set thehibernate-modelssettinghibernate.models.jandex.indexinstead. This method has no effect.User should useNamedStoredProcedureQuery insteadNo longer usedSee discussion ofTypeContributorin User Guide.UseTypeContributions.contributeType(BasicType)instead.UseTypeContributions.contributeType(BasicType)instead.UseNamedStrategyContributor insteadUseNamedStrategyContributor insteadThis has no effect and will be removed.No longer has any effect.since"hibernate.discard_pc_on_close" is deprecatedwith no replacement.hbm.xmlmapping file support is deprecated. Useextended orm.xml bindings instead.Set via thehibernate-modelssettinghibernate.models.jandex.indexinsteadNo longer supportedUseBootstrapContext.getModelsContext() instead.no longer calledwith no replacement.This operation is a layer-breaker, exposing an internal type. It will be removed. UseSessionFactoryOptions.buildSessionEventListeners()instead.This is unused and will be removed.with no replacement.This is no longer usedsince"hibernate.discard_pc_on_close" is deprecatedWill be removed without replacement. See HHH-15641Will be removed without replacement. See HHH-15641only because it's currently never 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 usedUseDialect.getForUpdateString(LockMode,Timeout) insteadUseDialect.getNativeValueGenerationStrategy() insteadOverride the methodrenderInsertIntoNoColumns()on thetranslatorreturned by this dialect.UseDialect.getReadLockString(Timeout) instead.UseDialect.getReadLockString(String, Timeout) instead.No dialect currently overrides this, so it's obsoleteUseTimeouts.getTimeoutInSeconds(int) instead.UseDialect.getWriteLockString(Timeout) instead.UseDialect.getWriteLockString(String, Timeout) instead.Use a providedSqlStringGenerationContextinstead.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!Just 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 implementBytecodeLazyAttributeInterceptorOnly used in one place, will be removedNo longer useful, since Java made downcasting saferNo longer useful, since Java made downcasting saferNo longer used, replaced bySharedSessionContractImplementor.instantiate(EntityPersister, Object)No longer useful, since Java made downcasting saferNo longer useful, since Java made downcasting saferUse@AuditOverride(forClass=SomeEntity.class)instead.useRevisionListenerinstead. While this method is being deprecated, expect a new API for this in 6.0.Instead use setLockOptionswith no replacement.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.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.This operation is not properly type safe. Note thatgraph.addAttributeNode(att).makeKeySubGraph()is a synonym forgraph.addMapKeySubgraph(att).This operation is not properly type safe. Note thatgraph.addAttributeNode(att).makeKeySubGraph(cl)is a synonym forgraph.addTreatedMapKeySubgraph(att,cl).This operation is not properly type safe. Note thatgraph.addAttributeNode(att).makeSubGraph()is a synonym forgraph.addSubgraph(att).This operation is not properly type safe. Note thatgraph.addAttributeNode(att).makeSubGraph(cl)is a synonym forgraph.addTreatedSubgraph(att,cl).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 ofGraphSemanticGraph.addElementSubgraph(PluralAttribute)was added in JPA 3.2, and so this method is no longer neededThis will be removedThis will be removedUseGraphSemantic.getJakartaHintName()insteadPlanned for removal in JPA 4Exposed for tests only.UseDatabaseStructure.configure(Optimizer)instead.Exposed for tests only.since it overrides a deprecated methodExposed for tests only.UseArray.newInstance(Class, int)instead.No longer usedNo longer usedNo longer usedDepending on context, eitherClassLoaderServiceorClassLoaderAccessshould be preferredNo longer usedNo longer usedNo longer usedsincePersistenceUnitTransactionTypewill be removed in JPA 4No longer has any effect.Always enabled. SeeJpaCompliance.isJpaCascadeComplianceEnabled()As LockOptions will become an SPI, this method will be removed with no replacementuseCheckConstraint.constraintString(Dialect)instead.No longer called, except from tests. UseKeyValue.createGenerator(Dialect, RootClass, Property, GeneratorSettings)No longer supportedSee discussion inEmbeddableCallback.See discussion inEmbeddableCallback.No longer supportedNo 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.becauseTable.ForeignKeyKeyshould be private.Should build aQualifiedTableNamethen useSqlStringGenerationContext.format(QualifiedTableName).UseDiscriminable.getDiscriminatorMapping()instead.No longer supportedshould be removedNo longer usedHigly inefficient - do not use; this exists to support other deprecated methods and will be removed.Only called from testsOnly called from testsNo longer calledNo longer calledHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here (generally),PluralAttributeMappingRead-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getElementDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getIdentifierDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getIndexDescriptor()Read-by-position makes this irrelevant. Currently still used bySQLQueryParserHibernate is moving away fromType. Correspondingmapping metamodel calls should be used instead - here,PluralAttributeMapping.getKeyDescriptor()by the supertypesHibernate no longer uses aliases to read from result setsHibernate no longer uses aliases to read from result setsHibernate no longer uses aliases to read from result setsHibernate no longer uses aliases to read from result setsThis feature is no longer supportedUseSelectableMapping.getSelectionExpression()insteadNo longer usedUseEntityPersister.getValues(java.lang.Object)insteadNo longer calledOnly ever used from places where we really want to useSelectStatement(select generator)InsertSelectStatementUpdateStatementDeleteStatement
SinceDiscriminatorMetadatais deprecatedUseEntityPersister.canReadFromCache()and/orEntityPersister.canWriteToCache()depending on needNo longer used in ORM coreuseEntityMutationTarget.getInsertDelegate()insteadNo longer used.org.hibernate.procedure.internal.ProcedureCallImpl.setParameter(Parameter<Date>, Date, TemporalType) sinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedsinceTemporalTypeis deprecatedorg.hibernate.query.criteria.HibernateCriteriaBuilder.arrayContainsAllNullable(Expression<T[]>, T[]) org.hibernate.query.criteria.HibernateCriteriaBuilder.arrayContainsAllNullable(T[], Expression<T[]>) This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(Subquery, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(Subquery, org.hibernate.query.common.JoinType, boolean)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(Class, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(EntityDomainType, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.join(JpaCteCriteria, org.hibernate.query.common.JoinType)This method is a layer-breaker, leaking the SQM typeSqmJoinTypeonto an API. It will be removed. UseJpaFrom.joinLateral(Subquery, org.hibernate.query.common.JoinType)No longer calledUseQuery.setEntityGraph(EntityGraph, GraphSemantic)which is more type safeUseQuery.setEntityGraph(EntityGraph, GraphSemantic)which is more type safeUseQuery.setEntityGraph(EntityGraph, GraphSemantic)which is more type safeSinceLockOptionsis transitioning to a new role as an SPI.The overloaded formQueryProducer.createQuery(String, Class)which takes a result type is strongly recommended in preference to this method, since it returns a typedQueryobject, and because it is able to use the given result type to infer theselectlist, and even sometimes thefromclause. Alternatively,QueryProducer.createSelectionQuery(String, Class)is preferred for queries, andQueryProducer.createMutationQuery(String)for insert, update, and delete statements.The overloaded formQueryProducer.createSelectionQuery(String, Class)which takes a result type is strongly recommended in preference to this method, since it returns a typedSelectionQueryobject, and because it is able to use the given result type to infer theselectlist, and even sometimes thefromclause.SinceLockOptionsis transitioning to a new role as an SPI.SinceImmutableEntityUpdateQueryHandlingModeis deprecated. UseQueryEngineOptions.allowImmutableEntityUpdate()instead.org.hibernate.query.sql.spi.NativeQueryImplementor.setParameter(Parameter<Date>, Date, TemporalType) ImplementArgumentsValidator.validate(List, String, BindingContext)insteaduseTypedParameterValue.typeuseTypedParameterValue.typeuseTypedParameterValue.valueBecause the semantics of this method may change in a future release. UseSession.find(Class, Object)instead.UseEntityManager.find(Class, Object, FindOption...)instead.This method will be removed. UseEntityManager.find(Class, Object, FindOption...)instead.The semantics of this method may change in a future release. UseSessionFactory.createGraphForDynamicEntity(String)together withEntityManager.find(EntityGraph, Object, FindOption...)to loaddynamic entities.The semantics of this method may change in a future release.This method will be removed. UseSessionFactory.createGraphForDynamicEntity(String)together withEntityManager.find(EntityGraph, Object, FindOption...)to loaddynamic entities.This method will be removed. UseEntityManager.lock(Object, LockModeType, LockOption...) insteadThis method will be removed. UseEntityManager.refresh(Object, RefreshOption...) insteadWith no real replacement. For some use cases tryStatelessSession.upsert(Object).With no real replacement. For some use cases tryStatelessSession.upsert(Object).This 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.UseSessionBuilder.tenantIdentifier(Object)insteadThere 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.No longer calledWill be removed. Use the other methods to visit each operation.Will be removed. Use the other methods to visit each operation.The existence of this method encourages people to pass around references to the SessionFactoryImplementor when they don't need itThis operation exposes the SPI typeStatementInspectorand is therefore a layer-breaker. UseStatelessSessionBuilder.statementInspector(UnaryOperator)instead.No longer supportedUseNonIdentifierAttribute.isDirtyCheckable()insteadnot appropriate for named enum or array typesnot appropriate for named enum or array typesnot appropriate for named enum or array types, useDdlType.getTypeName(Size, Type, DdlTypeRegistry)insteadnot appropriate for named enum or array types, useDdlType.getTypeName(Size, Type, DdlTypeRegistry)insteadnot appropriate for named enum or array types, useDdlTypeRegistry.getTypeName(int, Size, Type)insteadnot appropriate for named enum or array types, useDdlTypeRegistry.getTypeName(int, Size, Type)insteadNo longer usedThis 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 useIs not called anymore
- Deprecated ConstructorsConstructorDescriptionused by Quarkusprovide a
DatabaseVersioncurrently used by Hibernate Reactive This version of the constructor should handle the case in which we do actually have the option to access theDatabaseMetaData, but since Hibernate Reactive is currently not making use of it we take a shortcut.in favor ofSize(Integer, Integer, Long)in favor ofSize(Integer, Integer, Long)useRefreshEvent(Object, LockOptions, EventSource)instead.use the default constructor insteaduseStandardStack(Object)instead.UseLockOptions(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 Constants
- Deprecated Annotation Interface ElementsAnnotation Interface ElementDescriptionuse
GenericGenerator.type()for typesafetyuseSQLDelete.verify()with anExpectationclassuseSQLDeleteAll.verify()with anExpectationclassuseSQLInsert.verify()with anExpectationclassuseSQLUpdate.verify()with anExpectationclassUse@AuditOverride(forClass=SomeEntity.class)instead.