Class HibernateOrmConfigPersistenceUnit

java.lang.Object
io.quarkus.hibernate.orm.deployment.HibernateOrmConfigPersistenceUnit

public class HibernateOrmConfigPersistenceUnit extends Object
  • Field Details

    • 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

      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.
      fetch should 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.
      fetch should 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

      Mapping configuration.
    • query

      Query related configuration.
    • database

      Database related configuration.
    • jdbc

      JDBC related configuration.
    • fetch

      Fetching logic configuration.
    • cache

      Caching configuration
    • 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

      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.
    • unsupportedProperties

      @ConfigItem(generateDocumentation=false) @ConfigDocMapKey("full-property-key") public Map<String,String> unsupportedProperties
  • Constructor Details

    • HibernateOrmConfigPersistenceUnit

      public HibernateOrmConfigPersistenceUnit()
  • Method Details

    • isAnyPropertySet

      public boolean isAnyPropertySet()