Top Description Fields
org.hibernate.cfg

public Interface PersistenceSettings

Known Direct Subinterfaces
org.hibernate.cfg.AvailableSettings
Imports
org.hibernate.Incubating, .SessionFactoryObserver, jakarta.persistence.spi.PersistenceUnitInfo

Settings related to persistence-units
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
JAKARTA_TRANSACTION_TYPE

Specifies the type of transactions supported by the entity managers.

public static final String
JPA_CALLBACKS_ENABLED

Allows JPA callbacks (via jakarta.persistence.PreUpdate and friends) to be completely disabled.

public static final String
public static final String
JPA_TRANSACTION_TYPE

The type of transactions supported by the entity managers.

public static final String
PERSISTENCE_UNIT_NAME

Specifies the name of the persistence unit.

public static final String
SCANNER

Specifies an implementation of org.hibernate.boot.archive.scan.spi.Scanner, either:

  • an instance of Scanner,
  • a Class representing a class that implements Scanner
  • the name of a class that implements Scanner.
public static final String
SCANNER_ARCHIVE_INTERPRETER

Specifies an org.hibernate.boot.archive.spi.ArchiveDescriptorFactory to use in the scanning process, either:

  • an instance of ArchiveDescriptorFactory,
  • a Class representing a class that implements ArchiveDescriptorFactory, or
  • the name of a class that implements ArchiveDescriptorFactory.
public static final String
SCANNER_DISCOVERY

Identifies a comma-separated list of values indicating the types of things we should auto-detect during scanning.

public static final String
SESSION_FACTORY_NAME

Setting used to name the Hibernate org.hibernate.SessionFactory.

public static final String
SESSION_FACTORY_NAME_IS_JNDI

Does the value defined by SESSION_FACTORY_NAME represent a JNDI namespace into which the org.hibernate.SessionFactory should be bound and made accessible?

public static final String
SESSION_FACTORY_OBSERVER

Specifies a class which implements org.hibernate.SessionFactoryObserver and has a constructor with no parameters.

Field Detail

JAKARTA_PERSISTENCE_PROVIDERback to summary
public static final String JAKARTA_PERSISTENCE_PROVIDER

Specifies a class implementing jakarta.persistence.spi.PersistenceProvider. Naturally, this should always be org.hibernate.jpa.HibernatePersistenceProvider, which is the best damn persistence provider ever. There's no need to explicitly specify this setting when there are no inferior persistence providers floating about.

See JPA 2 sections 9.4.3 and 8.2.1.4

JAKARTA_TRANSACTION_TYPEback to summary
public static final String JAKARTA_TRANSACTION_TYPE

Specifies the type of transactions supported by the entity managers. The default depends on whether the program is considered to be executing in a Java SE or EE environment:

See JPA 2 sections 9.4.3 and 8.2.1.2

See Also
PersistenceUnitInfo#getTransactionType()
JPA_CALLBACKS_ENABLEDback to summary
public static final String JPA_CALLBACKS_ENABLED

Allows JPA callbacks (via jakarta.persistence.PreUpdate and friends) to be completely disabled. Mostly useful to save some memory when they are not used.

JPA callbacks are enabled by default. Set this property to false to disable them.

Experimental and will likely be removed as soon as the memory overhead is resolved.

Annotations
@Incubating
Since
5.4
See Also
org.hibernate.jpa.event.spi.CallbackType
JPA_PERSISTENCE_PROVIDERback to summary
public static final String JPA_PERSISTENCE_PROVIDER

Deprecated

Use JAKARTA_PERSISTENCE_PROVIDER instead

Annotations
@Deprecated
@SuppressWarnings:DeprecatedIsStillUsed
JPA_TRANSACTION_TYPEback to summary
public static final String JPA_TRANSACTION_TYPE

Deprecated

Use JAKARTA_TRANSACTION_TYPE instead

The type of transactions supported by the entity managers.

See JPA 2 sections 9.4.3 and 8.2.1.2

Annotations
@Deprecated
PERSISTENCE_UNIT_NAMEback to summary
public static final String PERSISTENCE_UNIT_NAME

Specifies the name of the persistence unit.

See Also
PersistenceUnitInfo#getPersistenceUnitName()
SCANNERback to summary
public static final String SCANNER

Specifies an implementation of org.hibernate.boot.archive.scan.spi.Scanner, either:

  • an instance of Scanner,
  • a Class representing a class that implements Scanner
  • the name of a class that implements Scanner.
See Also
org.hibernate.boot.MetadataBuilder#applyScanner
SCANNER_ARCHIVE_INTERPRETERback to summary
public static final String SCANNER_ARCHIVE_INTERPRETER

Specifies an org.hibernate.boot.archive.spi.ArchiveDescriptorFactory to use in the scanning process, either:

  • an instance of ArchiveDescriptorFactory,
  • a Class representing a class that implements ArchiveDescriptorFactory, or
  • the name of a class that implements ArchiveDescriptorFactory.

See information on org.hibernate.boot.archive.scan.spi.Scanner about expected constructor forms.

See Also
SCANNER, org.hibernate.boot.archive.scan.spi.Scanner, org.hibernate.boot.archive.scan.spi.AbstractScannerImpl, org.hibernate.boot.MetadataBuilder#applyArchiveDescriptorFactory
SCANNER_DISCOVERYback to summary
public static final String SCANNER_DISCOVERY

Identifies a comma-separated list of values indicating the types of things we should auto-detect during scanning. Allowable values include:

  • "class" specifies that .class files are discovered as managed classes
  • "hbm" specifies that hbm.xml files are discovered as mapping files
See Also
org.hibernate.boot.MetadataBuilder#applyScanOptions
SESSION_FACTORY_NAMEback to summary
public static final String SESSION_FACTORY_NAME

Setting used to name the Hibernate org.hibernate.SessionFactory.

Naming the SessionFactory allows for it to be properly serialized across JVMs as long as the same name is used on each JVM.

If SESSION_FACTORY_NAME_IS_JNDI is set to true, this is also the name under which the SessionFactory is bound into JNDI on startup and from which it can be obtained from JNDI.

See Also
SESSION_FACTORY_NAME_IS_JNDI, org.hibernate.internal.SessionFactoryRegistry, org.hibernate.boot.SessionFactoryBuilder#applyName(String)
SESSION_FACTORY_NAME_IS_JNDIback to summary
public static final String SESSION_FACTORY_NAME_IS_JNDI

Does the value defined by SESSION_FACTORY_NAME represent a JNDI namespace into which the org.hibernate.SessionFactory should be bound and made accessible?

Defaults to true for backwards compatibility.

Set this to false if naming a SessionFactory is needed for serialization purposes, but no writable JNDI context exists in the runtime environment or if the user simply does not want JNDI to be used.

See Also
SESSION_FACTORY_NAME, org.hibernate.boot.SessionFactoryBuilder#applyNameAsJndiName(boolean)
SESSION_FACTORY_OBSERVERback to summary
public static final String SESSION_FACTORY_OBSERVER

Specifies a class which implements org.hibernate.SessionFactoryObserver and has a constructor with no parameters.

See Also
org.hibernate.boot.SessionFactoryBuilder#addSessionFactoryObservers(SessionFactoryObserver...)