Class HibernateOrmConfigPersistenceUnit
- java.lang.Object
-
- io.quarkus.hibernate.orm.deployment.HibernateOrmConfigPersistenceUnit
-
public class HibernateOrmConfigPersistenceUnit extends Object
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description OptionalIntbatchFetchSizeDeprecated.fetchshould be used to configure fetching properties.Map<String,HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitCache>cacheCaching configurationHibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDatabasedatabaseDatabase related configuration.Optional<String>datasourceThe name of the datasource which this persistence unit uses.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDialectdialectDialect related configuration.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDiscriminatordiscriminatorDiscriminator related configuration.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitFetchfetchFetching logic configuration.Optional<String>implicitNamingStrategyPluggable strategy for applying implicit naming rules when an explicit name is not given.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitJdbcjdbcJDBC related configuration.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitMappingmappingMapping configuration.Optional<Set<String>>mappingFilesXML files to configure the entity mapping, e.g.OptionalIntmaxFetchDepthDeprecated.fetchshould be used to configure fetching properties.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.Optional<String>multitenantDefines the method for multi-tenancy (DATABASE, NONE, SCHEMA).Optional<String>multitenantSchemaDatasourceDefines the name of the datasource to use in case of SCHEMA approach.Optional<Set<String>>packagesThe packages in which the entities affected to this persistence unit are located.Optional<String>physicalNamingStrategyPluggable strategy contract for applying physical naming rules for database object names.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitQueryqueryQuery related configuration.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitQuoteIdentifiersquoteIdentifiersConfig related to identifier quoting.booleansecondLevelCachingEnabledThe default in Quarkus is for 2nd level caching to be enabled, and a good implementation is already integrated for you.Optional<List<String>>sqlLoadScriptPath to a file containing the SQL statements to execute when Hibernate ORM starts.Map<String,String>unsupportedPropertiesbooleanvalidateInDevModeIf 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.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceValidationvalidationBean Validation configuration.
-
Constructor Summary
Constructors Constructor Description HibernateOrmConfigPersistenceUnit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAnyPropertySet()
-
-
-
Field Detail
-
datasource
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> datasource
The 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>> packages
The packages in which the entities affected to this persistence unit are located.
-
dialect
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDialect dialect
Dialect related configuration.
-
sqlLoadScript
@ConfigItem(defaultValueDocumentation="import.sql in DEV, TEST ; no-file otherwise") @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<List<String>> sqlLoadScript
Path 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
@ConfigItem(defaultValueDocumentation="16") @Deprecated public OptionalInt 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
@ConfigItem @Deprecated public OptionalInt 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> physicalNamingStrategy
Pluggable 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> implicitNamingStrategy
Pluggable 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> metadataBuilderContributor
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. [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>> mappingFiles
XML 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 mapping
Mapping configuration.
-
query
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitQuery query
Query related configuration.
-
database
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDatabase database
Database related configuration.
-
jdbc
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitJdbc jdbc
JDBC related configuration.
-
fetch
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitFetch fetch
Fetching logic configuration.
-
cache
@ConfigItem @ConfigDocSection public Map<String,HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitCache> cache
Caching configuration
-
discriminator
@ConfigItem @ConfigDocSection public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDiscriminator discriminator
Discriminator related configuration.
-
quoteIdentifiers
@ConfigItem(defaultValue="none") public HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitQuoteIdentifiers quoteIdentifiers
Config related to identifier quoting.
-
secondLevelCachingEnabled
@ConfigItem(defaultValue="true") public boolean secondLevelCachingEnabled
The 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 validation
Bean Validation configuration.
-
multitenant
@ConfigItem @ConvertWith(io.quarkus.runtime.configuration.TrimmedStringConverter.class) public Optional<String> multitenant
Defines 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> multitenantSchemaDatasource
Defines 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 validateInDevMode
If 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.
-
-