Top Description Methods
org.hibernate.jpa.spi

public Interface JpaCompliance

Known Direct Subinterfaces
org.hibernate.jpa.spi.MutableJpaCompliance
Known Direct Implementers
org.hibernate.jpa.internal.JpaComplianceImpl
Imports
org.hibernate.Transaction

Encapsulates settings controlling whether certain aspects of the JPA spec should be strictly followed.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true indicates the generator name scope is considered global.
isGlobalGeneratorScopeEnabled
()

Should the the scope of javax.persistence.TableGenerator#name() and javax.persistence.SequenceGenerator#name() be considered globally or locally defined?

public boolean

Returns:

true says to act the spec-defined way.
isJpaCacheComplianceEnabled
()

Should Hibernate comply with all aspects of caching as defined by JPA?

public boolean

Returns:

true indicates to behave in the spec-defined way
isJpaClosedComplianceEnabled
()

JPA defines specific exceptions on specific methods when called on javax.persistence.EntityManager and javax.persistence.EntityManagerFactory when those objects have been closed.

public boolean

Returns:

true indicates to behave in the spec-defined way, interpreting the mapping as a "list", rather than a "bag"
isJpaListComplianceEnabled
()

Controls how Hibernate interprets a mapped List without an "order columns" specified.

public boolean

Returns:

true indicates to behave in the spec-defined way
isJpaProxyComplianceEnabled
()

JPA spec says that an javax.persistence.EntityNotFoundException should be thrown when accessing an entity Proxy which does not have an associated table row in the database.

public boolean

Returns:

true indicates to behave in the spec-defined way
isJpaQueryComplianceEnabled
()

Controls whether Hibernate's handling of JPA's javax.persistence.Query (JPQL, Criteria and native-query) should strictly follow the JPA spec.

public boolean

Returns:

true indicates to behave in the spec-defined way
isJpaTransactionComplianceEnabled
()

Indicates that Hibernate's Transaction should behave as defined by the spec for JPA's javax.persistence.EntityTransaction since it extends the JPA one.

Method Detail

isGlobalGeneratorScopeEnabledback to summary
public boolean isGlobalGeneratorScopeEnabled()

Should the the scope of javax.persistence.TableGenerator#name() and javax.persistence.SequenceGenerator#name() be considered globally or locally defined?

Returns:boolean

true indicates the generator name scope is considered global.

isJpaCacheComplianceEnabledback to summary
public 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"?

Implementation Note

Effects include marking all secondary tables as non-optional. The reason being that optional secondary tables can lead to entity cache being invalidated rather than updated.

Returns:boolean

true says to act the spec-defined way.

isJpaClosedComplianceEnabledback to summary
public boolean isJpaClosedComplianceEnabled()

JPA defines specific exceptions on specific methods when called on javax.persistence.EntityManager and javax.persistence.EntityManagerFactory 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:boolean

true indicates to behave in the spec-defined way

isJpaListComplianceEnabledback to summary
public 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 a org.hibernate.collection.internal.PersistentList, otherwise Hibernate will treat is as a org.hibernate.collection.internal.PersistentBag

Returns:boolean

true indicates to behave in the spec-defined way, interpreting the mapping as a "list", rather than a "bag"

isJpaProxyComplianceEnabledback to summary
public boolean isJpaProxyComplianceEnabled()

JPA spec says that an javax.persistence.EntityNotFoundException 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:boolean

true indicates to behave in the spec-defined way

isJpaQueryComplianceEnabledback to summary
public boolean isJpaQueryComplianceEnabled()

Controls whether Hibernate's handling of JPA's javax.persistence.Query (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 the javax.persistence.Query methods throwing spec defined exceptions where as Hibernate might not. Deviations result in an exception if enabled

Returns:boolean

true indicates to behave in the spec-defined way

isJpaTransactionComplianceEnabledback to summary
public boolean isJpaTransactionComplianceEnabled()

Indicates that Hibernate's Transaction should behave as defined by the spec for JPA's javax.persistence.EntityTransaction since it extends the JPA one.

Returns:boolean

true indicates to behave in the spec-defined way