Class HibernateOrmConfigPersistenceUnit
java.lang.Object
io.quarkus.hibernate.orm.deployment.HibernateOrmConfigPersistenceUnit
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classDiscriminator configuration.static classstatic classstatic classMapping-related configuration.static classstatic classstatic classstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.Caching configurationDatabase related configuration.The name of the datasource which this persistence unit uses.Dialect related configuration.Discriminator related configuration.Fetching logic configuration.Pluggable strategy for applying implicit naming rules when an explicit name is not given.JDBC related configuration.Mapping configuration.XML files to configure the entity mapping, e.g.Deprecated.fetchshould be used to configure fetching properties.Class name of a custom https://docs.jboss.org/hibernate/stable/orm/javadocs/org/hibernate/boot/spi/MetadataBuilderContributor.html[`org.hibernate.boot.spi.MetadataBuilderContributor`] implementation.Defines the method for multi-tenancy (DATABASE, NONE, SCHEMA).Defines the name of the datasource to use in case of SCHEMA approach.The packages in which the entities affected to this persistence unit are located.Pluggable strategy contract for applying physical naming rules for database object names.Query related configuration.Config related to identifier quoting.booleanThe default in Quarkus is for 2nd level caching to be enabled, and a good implementation is already integrated for you.Path to a file containing the SQL statements to execute when Hibernate ORM starts.booleanIf hibernate is not auto generating the schema, and Quarkus is running in development mode then Quarkus will attempt to validate the database after startup and print a log message if there are any problems.Bean Validation configuration. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
datasource
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> datasourceThe name of the datasource which this persistence unit uses.If undefined, it will use the default datasource.
-
packages
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<Set<String>> packagesThe packages in which the entities affected to this persistence unit are located. -
dialect
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDialect dialectDialect related configuration. -
sqlLoadScript
@ConfigItem(defaultValueDocumentation="import.sql in DEV, TEST ; no-file otherwise") @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<List<String>> sqlLoadScriptPath to a file containing the SQL statements to execute when Hibernate ORM starts. The file is retrieved from the classpath resources, so it must be located in the resources directory (e.g. `src/main/resources`). The default value for this setting differs depending on the Quarkus launch mode: * In dev and test modes, it defaults to `import.sql`. Simply add an `import.sql` file in the root of your resources directory and it will be picked up without having to set this property. Pass `no-file` to force Hibernate ORM to ignore the SQL import file. * In production mode, it defaults to `no-file`. It means Hibernate ORM won't try to execute any SQL import file by default. Pass an explicit value to force Hibernate ORM to execute the SQL import file. If you need different SQL statements between dev mode, test (`@QuarkusTest`) and in production, use Quarkus https://quarkus.io/guides/config#configuration-profiles[configuration profiles facility]. [source,property] .application.properties ---- %dev.quarkus.hibernate-orm.sql-load-script = import-dev.sql %test.quarkus.hibernate-orm.sql-load-script = import-test.sql %prod.quarkus.hibernate-orm.sql-load-script = no-file ---- [NOTE] ==== Quarkus supports `.sql` file with SQL statements or comments spread over multiple lines. Each SQL statement must be terminated by a semicolon. ==== -
batchFetchSize
Deprecated.fetchshould be used to configure fetching properties.The size of the batches used when loading entities and collections. `-1` means batch loading is disabled. -
maxFetchDepth
Deprecated.fetchshould be used to configure fetching properties.The maximum depth of outer join fetch tree for single-ended associations (one-to-one, many-to-one). A `0` disables default outer join fetching. -
physicalNamingStrategy
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> physicalNamingStrategyPluggable strategy contract for applying physical naming rules for database object names. Class name of the Hibernate PhysicalNamingStrategy implementation -
implicitNamingStrategy
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> implicitNamingStrategyPluggable strategy for applying implicit naming rules when an explicit name is not given. Class name of the Hibernate ImplicitNamingStrategy implementation -
metadataBuilderContributor
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> metadataBuilderContributorClass name of a custom https://docs.jboss.org/hibernate/stable/orm/javadocs/org/hibernate/boot/spi/MetadataBuilderContributor.html[`org.hibernate.boot.spi.MetadataBuilderContributor`] implementation. [NOTE] ==== Not all customization options exposed by https://docs.jboss.org/hibernate/stable/orm/javadocs/org/hibernate/boot/MetadataBuilder.html[`org.hibernate.boot.MetadataBuilder`] will work correctly. Stay clear of options related to classpath scanning in particular. This setting is exposed mainly to allow registration of types, converters and SQL functions. ==== -
mappingFiles
@ConfigItem(defaultValueDocumentation="META-INF/orm.xml if it exists; no-file otherwise") @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<Set<String>> mappingFilesXML files to configure the entity mapping, e.g.META-INF/my-orm.xml.Defaults to `META-INF/orm.xml` if it exists. Pass `no-file` to force Hibernate ORM to ignore `META-INF/orm.xml`.
-
mapping
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitMapping mappingMapping configuration. -
query
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitQuery queryQuery related configuration. -
database
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDatabase databaseDatabase related configuration. -
jdbc
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitJdbc jdbcJDBC related configuration. -
fetch
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitFetch fetchFetching logic configuration. -
cache
@ConfigItem @ConfigDocSection public Map<String,HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitCache> cacheCaching configuration -
discriminator
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDiscriminator discriminatorDiscriminator related configuration. -
quoteIdentifiers
@ConfigItem(defaultValue="none") public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitQuoteIdentifiers quoteIdentifiersConfig related to identifier quoting. -
secondLevelCachingEnabled
@ConfigItem(defaultValue="true") public boolean secondLevelCachingEnabledThe default in Quarkus is for 2nd level caching to be enabled, and a good implementation is already integrated for you.Just cherry-pick which entities should be using the cache.
Set this to false to disable all 2nd level caches.
-
validation
@ConfigItem public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceValidation validationBean Validation configuration. -
multitenant
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> multitenantDefines the method for multi-tenancy (DATABASE, NONE, SCHEMA). The complete list of allowed values is available in the https://javadoc.io/doc/org.hibernate/hibernate-core/5.6.10.Final/org/hibernate/MultiTenancyStrategy.html[Hibernate ORM JavaDoc]. The type DISCRIMINATOR is currently not supported. The default value is NONE (no multi-tenancy). -
multitenantSchemaDatasource
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> multitenantSchemaDatasourceDefines the name of the datasource to use in case of SCHEMA approach. The datasource of the persistence unit will be used if not set. -
validateInDevMode
@ConfigItem(defaultValue="true") public boolean validateInDevModeIf hibernate is not auto generating the schema, and Quarkus is running in development mode then Quarkus will attempt to validate the database after startup and print a log message if there are any problems. -
unsupportedProperties
-
-
Constructor Details
-
HibernateOrmConfigPersistenceUnit
public HibernateOrmConfigPersistenceUnit()
-
-
Method Details
-
isAnyPropertySet
public boolean isAnyPropertySet()
-
fetchshould be used to configure fetching properties.