Package org.hibernate.cfg
Interface JpaComplianceSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
public interface JpaComplianceSettings
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
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.static final String
Deprecated.No longer has any effect.static final String
JPA specifies that anIllegalStateException
must be thrown byEntityManager.close()
andEntityManagerFactory.close()
if the object has already been closed.static final String
Specifies a default value for allJpaCompliance
flags.static final String
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.static final String
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.static final String
JPA specifies that items occurring inOrderBy
lists must be references to entity attributes, whereas Hibernate, by default, allows more complex expressions.static final String
The JPA specification insists that anEntityNotFoundException
must be thrown whenever an uninitialized entity proxy with no corresponding row in the database is accessed.static final String
static final String
When enabled, specifies that the HibernateTransaction
should behave according to the semantics defined by the JPA specification for anEntityTransaction
.static final String
Deprecated.PreferJPA_QUERY_COMPLIANCE
-
Field Details
-
JPA_COMPLIANCE
Specifies a default value for allJpaCompliance
flags. Each individual flag may still be overridden by explicitly specifying its specific configuration property.- Since:
- 6.0
- See Also:
- Default Value:
true
with JPA bootstrapping;false
otherwise.
-
JPA_TRANSACTION_COMPLIANCE
When enabled, specifies that the HibernateTransaction
should behave according to the semantics defined by the JPA specification for anEntityTransaction
.- Since:
- 5.3
- See Also:
- Default Value:
JPA_COMPLIANCE
-
JPA_QUERY_COMPLIANCE
Controls whether Hibernate’s handling ofQuery
(JPQL, Criteria and native) should strictly follow the requirements defined in the Jakarta Persistence specification, both in terms of JPQL validation and behavior ofQuery
method implementations.- Since:
- 5.3
- See Also:
- API Note:
- When disabled, allows the many useful features of HQL
- Default Value:
JPA_COMPLIANCE
-
JPA_CASCADE_COMPLIANCE
Deprecated.No longer has any effect. Since 7.0 (and removal of save/update processing), Hibernate always cascades PERSIST- See Also:
-
JPA_ORDER_BY_MAPPING_COMPLIANCE
JPA specifies that items occurring inOrderBy
lists must be references to entity attributes, whereas Hibernate, by default, allows more complex expressions.- Since:
- 6.0
- See Also:
- API Note:
- If enabled, an exception is thrown for items which are not entity attribute references.
- Default Value:
JPA_COMPLIANCE
-
JPA_CLOSED_COMPLIANCE
JPA specifies that anIllegalStateException
must be thrown byEntityManager.close()
andEntityManagerFactory.close()
if the object has already been closed. By default, Hibernate treats any additional call toclose()
as a noop.- Since:
- 5.3
- See Also:
- API Note:
- When enabled, this setting forces Hibernate to throw an exception if
close()
is called on an instance that was already closed. - Default Value:
JPA_COMPLIANCE
-
JPA_PROXY_COMPLIANCE
The JPA specification insists that anEntityNotFoundException
must 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:
- API Note:
- When enabled, this setting forces Hibernate to initialize the entity proxy when its identifier is accessed. Clearly, this setting is not recommended.
- Default Value:
JPA_COMPLIANCE
-
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.
- Since:
- 5.3
- See Also:
- API Note:
- Hibernate's default behavior here is safer and more careful than the behavior mandated by the TCK but YOLO
- Default Value:
JPA_COMPLIANCE
-
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:
- API Note:
- If enabled, the name will be considered globally scoped, and so the existence of two different generators with the same name will be considered a collision, and will result in an exception during bootstrap.
- Default Value:
JPA_COMPLIANCE
-
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, anInteger
argument might be widened toLong
.- Since:
- 6.0
- See Also:
- API Note:
- When enabled, coercion is disallowed, as required by the JPA specification. Hibernate's default (here non-compliant) behavior is to allow the coercion.
- Default Value:
JPA_COMPLIANCE
-
JPAQL_STRICT_COMPLIANCE
Deprecated.PreferJPA_QUERY_COMPLIANCE
- See Also:
-