Package org.hibernate.cfg
Interface JpaComplianceSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
public interface JpaComplianceSettings
- Author:
- Steve Ebersole
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBy default, Hibernate uses second-level cache invalidation for entities with secondary tables in order to avoid the possibility of inconsistent cached data in the case where different transactions simultaneously update different table rows corresponding to the same entity instance.static final StringControls whether Hibernate applies cascadeCascadeType.PERSISTorCascadeType.SAVE_UPDATEat flush time.static final StringJPA specifies that anIllegalStateExceptionmust be thrown byEntityManager.close()andEntityManagerFactory.close()if the object has already been closed.static final StringSpecifies a default value for allJpaComplianceflags.static final StringDetermines whether the scope of any identifier generator name specified viaTableGenerator.name()orSequenceGenerator.name()is considered global to the persistence unit, or local to the entity in which identifier generator is defined.static final StringDeprecated.static final StringDetermines if an identifier value passed toEntityManager.find(java.lang.Class<T>, java.lang.Object)orEntityManager.getReference(java.lang.Class<T>, java.lang.Object)may be coerced to the identifier type declared by the entity.static final StringJPA specifies that items occurring inOrderBylists must be references to entity attributes, whereas Hibernate, by default, allows more complex expressions.static final StringThe JPA specification insists that anEntityNotFoundExceptionmust be thrown whenever an uninitialized entity proxy with no corresponding row in the database is accessed.static final Stringstatic final StringWhen enabled, specifies that the HibernateTransactionshould behave according to the semantics defined by the JPA specification for anEntityTransaction.static final StringDeprecated.PreferJPA_QUERY_COMPLIANCE
-
Field Details
-
JPA_COMPLIANCE
Specifies a default value for allJpaComplianceflags. Each individual flag may still be overridden by explicitly specifying its specific configuration property. -
JPA_TRANSACTION_COMPLIANCE
When enabled, specifies that the HibernateTransactionshould behave according to the semantics defined by the JPA specification for anEntityTransaction. -
JPA_QUERY_COMPLIANCE
-
JPA_CASCADE_COMPLIANCE
Controls whether Hibernate applies cascadeCascadeType.PERSISTorCascadeType.SAVE_UPDATEat flush time. If enabled, Hibernate will cascade the standard JPAPERSISToperation. Otherwise, Hibernate will cascade the legacySAVE_UPDATEoperation.- Since:
- 6.6
- See Also:
-
JPA_LIST_COMPLIANCE
Deprecated.UseMappingSettings.DEFAULT_LIST_SEMANTICSinstead. The specification actually leaves this behavior undefined, saying that portable applications should not rely on any specific behavior for aListwith no@OrderColumn. -
JPA_ORDER_BY_MAPPING_COMPLIANCE
JPA specifies that items occurring inOrderBylists must be references to entity attributes, whereas Hibernate, by default, allows more complex expressions. -
JPA_CLOSED_COMPLIANCE
JPA specifies that anIllegalStateExceptionmust be thrown byEntityManager.close()andEntityManagerFactory.close()if the object has already been closed. By default, Hibernate treats any additional call toclose()as a noop. -
JPA_PROXY_COMPLIANCE
The JPA specification insists that anEntityNotFoundExceptionmust be thrown whenever an uninitialized entity proxy with no corresponding row in the database is accessed. For most programs, this results in many completely unnecessary round trips to the database.Traditionally, Hibernate does not initialize an entity proxy when its identifier attribute is accessed, since the identifier value is already known and held in the proxy instance. This behavior saves the round trip to the database.
- Since:
- 5.2.13
- See Also:
-
JPA_CACHING_COMPLIANCE
By default, Hibernate uses second-level cache invalidation for entities with secondary tables in order to avoid the possibility of inconsistent cached data in the case where different transactions simultaneously update different table rows corresponding to the same entity instance.The Jakarta Persistence TCK, requires that entities with secondary tables be immediately cached in the second-level cache rather than invalidated and re-cached on a subsequent read.
-
JPA_ID_GENERATOR_GLOBAL_SCOPE_COMPLIANCE
Determines whether the scope of any identifier generator name specified viaTableGenerator.name()orSequenceGenerator.name()is considered global to the persistence unit, or local to the entity in which identifier generator is defined.- Since:
- 5.2.17
- See Also:
-
JPA_LOAD_BY_ID_COMPLIANCE
Determines if an identifier value passed toEntityManager.find(java.lang.Class<T>, java.lang.Object)orEntityManager.getReference(java.lang.Class<T>, java.lang.Object)may be coerced to the identifier type declared by the entity. For example, anIntegerargument might be widened toLong.- Since:
- 6.0
- See Also:
-
JPAQL_STRICT_COMPLIANCE
Deprecated.PreferJPA_QUERY_COMPLIANCE- See Also:
-
MappingSettings.DEFAULT_LIST_SEMANTICSinstead.