Top Fields Constructors Methods
org.hibernate.jpa.internal

public Class MutableJpaComplianceImpl

extends Object
implements MutableJpaCompliance
Class Inheritance
All Implemented Interfaces
org.hibernate.jpa.spi.MutableJpaCompliance, org.hibernate.jpa.spi.JpaCompliance
Imports
java.util.Map, org.hibernate.cfg.AvailableSettings, org.hibernate.internal.util.config.ConfigurationHelper, org.hibernate.jpa.spi.JpaCompliance, .MutableJpaCompliance

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
MutableJpaComplianceImpl(Map<?, ?> configurationSettings)

public
MutableJpaComplianceImpl(Map<?, ?> configurationSettings, boolean jpaByDefault)

Method Summary

Modifier and TypeMethod and Description
public JpaCompliance
public boolean
public boolean
isJpaCacheComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaCacheComplianceEnabled.

Should Hibernate comply with all aspects of caching as defined by JPA?
public boolean
isJpaClosedComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaClosedComplianceEnabled.

JPA defines specific exceptions on specific methods when called on jakarta.persistence.EntityManager and jakarta.persistence.EntityManagerFactory when those objects have been closed.
public boolean
isJpaListComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaListComplianceEnabled.

Controls how Hibernate interprets a mapped java.util.List without no order column specified.
public boolean
public boolean
isJpaProxyComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaProxyComplianceEnabled.

JPA spec says that an jakarta.persistence.EntityNotFoundException should be thrown when accessing an entity proxy which does not have an associated table row in the database.
public boolean
isJpaQueryComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaQueryComplianceEnabled.

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

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaTransactionComplianceEnabled.

Indicates that Hibernate's Transaction should behave as defined by the specification for JPA's jakarta.persistence.EntityTransaction since it extends it.
public boolean
isLoadByIdComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isLoadByIdComplianceEnabled.

JPA says that the id passed to jakarta.persistence.EntityManager#getReference and jakarta.persistence.EntityManager#find should be exactly the expected type, allowing no type coercion.
public void
public void
public void
public void
public void
public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachingComplianceback to summary
private boolean cachingCompliance
closedComplianceback to summary
private boolean closedCompliance
generatorNameScopeComplianceback to summary
private boolean generatorNameScopeCompliance
listComplianceback to summary
private boolean listCompliance
loadByIdComplianceback to summary
private boolean loadByIdCompliance
orderByMappingComplianceback to summary
private boolean orderByMappingCompliance
proxyComplianceback to summary
private boolean proxyCompliance
queryComplianceback to summary
private boolean queryCompliance
transactionComplianceback to summary
private boolean transactionCompliance

Constructor Detail

MutableJpaComplianceImplback to summary
public MutableJpaComplianceImpl(Map<?, ?> configurationSettings)
MutableJpaComplianceImplback to summary
public MutableJpaComplianceImpl(Map<?, ?> configurationSettings, boolean jpaByDefault)
Annotations
@SuppressWarnings:ConstantConditions

Method Detail

immutableCopyback to summary
public JpaCompliance immutableCopy()

Implements org.hibernate.jpa.spi.MutableJpaCompliance.immutableCopy.

Annotations
@Override
isGlobalGeneratorScopeEnabledback to summary
public boolean isGlobalGeneratorScopeEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isGlobalGeneratorScopeEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isGlobalGeneratorScopeEnabled.

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

Returns:boolean

true if the generator name scope is considered global

Annotations
@Override
isJpaCacheComplianceEnabledback to summary
public boolean isJpaCacheComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaCacheComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.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:boolean

true indicates to behave in the spec-defined way

Annotations
@Override
isJpaClosedComplianceEnabledback to summary
public boolean isJpaClosedComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaClosedComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isJpaClosedComplianceEnabled.

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

Annotations
@Override
isJpaListComplianceEnabledback to summary
public boolean isJpaListComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaListComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isJpaListComplianceEnabled.

Controls how Hibernate interprets a mapped java.util.List without no order column specified. Historically Hibernate treats this as a "bag", which is a concept JPA does not have.

  • If enabled, Hibernate will recognize this case as a list.
  • Otherwise, if disabled, Hibernate will treat it as a "bag".
Returns:boolean

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

Annotations
@Override
isJpaOrderByMappingComplianceEnabledback to summary
public boolean isJpaOrderByMappingComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaOrderByMappingComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isJpaOrderByMappingComplianceEnabled.

Should we strictly handle jakarta.persistence.OrderBy expressions?

JPA says the order-items can only be attribute references whereas Hibernate supports a wide range of items. With this enabled, Hibernate will throw a compliance error when a non-attribute-reference is used.

Annotations
@Override
isJpaProxyComplianceEnabledback to summary
public boolean isJpaProxyComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaProxyComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isJpaProxyComplianceEnabled.

JPA spec says that an jakarta.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 round trip.

If enabled Hibernate will initialize the entity proxy even when accessing its identifier.

Returns:boolean

true indicates to behave in the spec-defined way

Annotations
@Override
isJpaQueryComplianceEnabledback to summary
public boolean isJpaQueryComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaQueryComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isJpaQueryComplianceEnabled.

Controls whether Hibernate's handling of JPA's jakarta.persistence.Query (JPQL, Criteria and native-query) should strictly follow the JPA spec. This includes parsing and translating a query as JPQL instead of HQL, as well as whether calls to the jakarta.persistence.Query methods always throw the exceptions defined by the specification.

Deviations result in an exception, if enabled.

Returns:boolean

true indicates to behave in the spec-defined way

Annotations
@Override
isJpaTransactionComplianceEnabledback to summary
public boolean isJpaTransactionComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isJpaTransactionComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isJpaTransactionComplianceEnabled.

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

Returns:boolean

true indicates to behave in the spec-defined way

Annotations
@Override
isLoadByIdComplianceEnabledback to summary
public boolean isLoadByIdComplianceEnabled()

Implements org.hibernate.jpa.spi.JpaCompliance.isLoadByIdComplianceEnabled.

Doc from org.hibernate.jpa.spi.JpaCompliance.isLoadByIdComplianceEnabled.

JPA says that the id passed to jakarta.persistence.EntityManager#getReference and jakarta.persistence.EntityManager#find should be exactly the expected type, allowing no type coercion.

Historically, Hibernate behaved the same way. Since 6.0 however, Hibernate has the ability to coerce the passed type to the expected type. For example, an Integer may be widened to Long. Coercion is performed by calling org.hibernate.type.descriptor.java.JavaType#coerce.

This setting controls whether such coercion should be allowed.

Annotations
@Override
setCachingComplianceback to summary
public void setCachingCompliance(boolean cachingCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setCachingCompliance.

Annotations
@Override
setClosedComplianceback to summary
public void setClosedCompliance(boolean closedCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setClosedCompliance.

Annotations
@Override
setGeneratorNameScopeComplianceback to summary
public void setGeneratorNameScopeCompliance(boolean enabled)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setGeneratorNameScopeCompliance.

Annotations
@Override
setListComplianceback to summary
public void setListCompliance(boolean listCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setListCompliance.

Annotations
@Override
setLoadByIdComplianceback to summary
public void setLoadByIdCompliance(boolean enabled)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setLoadByIdCompliance.

Annotations
@Override
setOrderByMappingComplianceback to summary
public void setOrderByMappingCompliance(boolean orderByMappingCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setOrderByMappingCompliance.

Annotations
@Override
setProxyComplianceback to summary
public void setProxyCompliance(boolean proxyCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setProxyCompliance.

Annotations
@Override
setQueryComplianceback to summary
public void setQueryCompliance(boolean queryCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setQueryCompliance.

setTransactionComplianceback to summary
public void setTransactionCompliance(boolean transactionCompliance)

Implements org.hibernate.jpa.spi.MutableJpaCompliance.setTransactionCompliance.

Annotations
@Override