Package org.hibernate.jpa.spi
Interface JpaCompliance
-
- All Known Subinterfaces:
MutableJpaCompliance
public interface JpaCompliance
Encapsulates settings controlling whether certain aspects of the JPA spec should be strictly followed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isGlobalGeneratorScopeEnabled()
Should the the scope ofTableGenerator.name()
andSequenceGenerator.name()
be considered globally or locally defined?boolean
isJpaCacheComplianceEnabled()
Should Hibernate comply with all aspects of caching as defined by JPA? Or can it deviate to perform things it believes will be "better"?boolean
isJpaClosedComplianceEnabled()
JPA defines specific exceptions on specific methods when called onEntityManager
andEntityManagerFactory
when those objects have been closed.boolean
isJpaListComplianceEnabled()
Controls how Hibernate interprets a mapped List without an "order columns" specified.boolean
isJpaProxyComplianceEnabled()
JPA spec says that anEntityNotFoundException
should be thrown when accessing an entity Proxy which does not have an associated table row in the database.boolean
isJpaQueryComplianceEnabled()
Controls whether Hibernate's handling of JPA'sQuery
(JPQL, Criteria and native-query) should strictly follow the JPA spec.boolean
isJpaTransactionComplianceEnabled()
Indicates that Hibernate'sTransaction
should behave as defined by the spec for JPA'sEntityTransaction
since it extends the JPA one.
-
-
-
Method Detail
-
isJpaQueryComplianceEnabled
boolean isJpaQueryComplianceEnabled()
Controls whether Hibernate's handling of JPA'sQuery
(JPQL, Criteria and native-query) should strictly follow the JPA spec. This includes both in terms of parsing or translating a query as well as calls to theQuery
methods throwing spec defined exceptions where as Hibernate might not. Deviations result in an exception if enabled- Returns:
true
indicates to behave in the spec-defined way
-
isJpaTransactionComplianceEnabled
boolean isJpaTransactionComplianceEnabled()
Indicates that Hibernate'sTransaction
should behave as defined by the spec for JPA'sEntityTransaction
since it extends the JPA one.- Returns:
true
indicates to behave in the spec-defined way
-
isJpaListComplianceEnabled
boolean isJpaListComplianceEnabled()
Controls how Hibernate interprets a mapped List without an "order columns" specified. Historically Hibernate defines this as a "bag", which is a concept JPA does not have. If enabled, Hibernate will recognize this condition as defining aPersistentList
, otherwise Hibernate will treat is as aPersistentBag
- Returns:
true
indicates to behave in the spec-defined way, interpreting the mapping as a "list", rather than a "bag"
-
isJpaClosedComplianceEnabled
boolean isJpaClosedComplianceEnabled()
JPA defines specific exceptions on specific methods when called onEntityManager
andEntityManagerFactory
when those objects have been closed. This setting controls whether the spec defined behavior or Hibernate's behavior will be used. If enabled Hibernate will operate in the JPA specified way throwing exceptions when the spec says it should with regard to close checking- Returns:
true
indicates to behave in the spec-defined way
-
isJpaProxyComplianceEnabled
boolean isJpaProxyComplianceEnabled()
JPA spec says that anEntityNotFoundException
should be thrown when accessing an entity Proxy which does not have an associated table row in the database. Traditionally, Hibernate does not initialize an entity Proxy when accessing its identifier since we already know the identifier value, hence we can save a database roundtrip. If enabled Hibernate will initialize the entity Proxy even when accessing its identifier.- Returns:
true
indicates to behave in the spec-defined way
-
isJpaCacheComplianceEnabled
boolean isJpaCacheComplianceEnabled()
Should Hibernate comply with all aspects of caching as defined by JPA? Or can it deviate to perform things it believes will be "better"?- Returns:
true
says to act the spec-defined way.
-
isGlobalGeneratorScopeEnabled
boolean isGlobalGeneratorScopeEnabled()
Should the the scope ofTableGenerator.name()
andSequenceGenerator.name()
be considered globally or locally defined?- Returns:
true
indicates the generator name scope is considered global.
-
-