= Read me
:config-file: microprofile-config.properties
:toc:

This module is testing the configuration and integration aspects of JPA;
for example it covers reading configuration properties from the Quarkus config files as an alternative to the `persistence.xml`.

All integration tests in this module use `H2`; other databases are being tested from other integration test modules.

== How to run tests from the IDE

They should just work: no preparation needed for this module.

== Documentation

See the `docs` section and the Hibernate guide.

== Design questions

* Is it appropriate to prioritize `persistence.xml` when it is present and ignore otherwise (i.e. disable automatic PU generation when `persistence.xml` is there
** [SOLVED] we go for not allowing both
* Is it appropriate to select `JTA` as the transaction type strategy
* Is it appropriate to detect the dialect from the driver
** [SOLVED] we start from that and can add runtime refinement of the dialect based on JDBC metadata and enlist all dialects of a family to avoid DCE
* Which properties are the most useful for Hibernate ORM?
** see section below
* Do we have a pass through of properties under something like `quarkus.hibernate`
** [SOLVED] we start with that
* which prefix do we want? `quarkus.hibernate`, `hibernate`, `jpa` etc
** what about `javax.persistence properties`?
** [SOLVED] we start with `quarkus.hibernate`

=== List of properties

I am doing a first pass on the properties and I want to propose the following properties (and nothing else):

* `hibernate.dialect`
* `hibernate.show_sql` (and then `hibernate.format_sql` ?)
    * should show_sql not do System.out but rather a proper log
* `javax.persistence.schema-generation.database.action`

Anything else?

I would force the following:

* `javax.persistence.sharedCache.mode` to yes
* `javax.persistence.sql-load-script-source` set to a default file name

Questions do we need:

* `javax.persistence.transactionType`


