Interface HibernateOrmConfigPersistenceUnit


public interface HibernateOrmConfigPersistenceUnit
  • Method Details

    • datasource

      @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> datasource()
      The name of the datasource which this persistence unit uses.

      If undefined, it will use the default datasource.

    • packages

      Optional<Set<@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) String>> packages()
      The packages in which the entities affected to this persistence unit are located.
    • dialect

      Dialect related configuration.
    • sqlLoadScript

      @ConfigDocDefault("import.sql in dev and test modes ; no-file otherwise") Optional<List<@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) String>> sqlLoadScript()
      Paths to files containing the SQL statements to execute when Hibernate ORM starts. The files are retrieved from the classpath resources, so they 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

      @ConfigDocDefault("16") @Deprecated 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

      @Deprecated 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

      @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> physicalNamingStrategy()
      Pluggable strategy contract for applying physical naming rules for database object names. Class name of the Hibernate PhysicalNamingStrategy implementation
    • implicitNamingStrategy

      @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) 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

      @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) 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

      @ConfigDocDefault("META-INF/orm.xml if it exists; no-file otherwise") Optional<Set<@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) 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

      Config related to identifier quoting.
    • secondLevelCachingEnabled

      @WithDefault("true") 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

      @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) 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

      @Deprecated @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> multitenantSchemaDatasource()
      Deprecated.
      Use datasource() instead.
      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

      @WithDefault("true") 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

      @ConfigDocIgnore @ConfigDocMapKey("full-property-key") Map<String,String> unsupportedProperties()
    • isAnyPropertySet

      default boolean isAnyPropertySet()