Skip to content

Commit e670754

Browse files
committed
Sync documentation of main branch
1 parent 23074a8 commit e670754

File tree

8 files changed

+541
-324
lines changed

8 files changed

+541
-324
lines changed

_generated-doc/main/config/quarkus-all-config.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19610,6 +19610,36 @@ endif::add-copy-button-to-env-var[]
1961019610
|
1961119611

1961219612

19613+
h|[[quarkus-hibernate-orm_section_quarkus-hibernate-orm-flush]] [.section-name.section-level0]##Flush configuration##
19614+
h|Type
19615+
h|Default
19616+
19617+
a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-flush-mode]] [.property-path]##`quarkus.hibernate-orm.flush.mode`##
19618+
19619+
`quarkus.hibernate-orm."persistence-unit-name".flush.mode`
19620+
19621+
[.description]
19622+
--
19623+
The default flushing strategy, or when to flush entities to the database in a Hibernate session:
19624+
before every query, on commit, ...
19625+
19626+
This default can be overridden on a per-session basis with `Session#setHibernateFlushMode()`
19627+
or on a per-query basis with the hint `HibernateHints#HINT_FLUSH_MODE`.
19628+
19629+
See the javadoc of `org.hibernate.FlushMode` for details.
19630+
19631+
19632+
ifdef::add-copy-button-to-env-var[]
19633+
Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_FLUSH_MODE+++[]
19634+
endif::add-copy-button-to-env-var[]
19635+
ifndef::add-copy-button-to-env-var[]
19636+
Environment variable: `+++QUARKUS_HIBERNATE_ORM_FLUSH_MODE+++`
19637+
endif::add-copy-button-to-env-var[]
19638+
--
19639+
a|`manual`, `commit`, `auto`, `always`
19640+
|`auto`
19641+
19642+
1961319643

1961419644
h|[.extension-name]##Hibernate Search + Elasticsearch##
1961519645
h|Type

_generated-doc/main/config/quarkus-hibernate-orm.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,36 @@ endif::add-copy-button-to-env-var[]
11701170
|
11711171

11721172

1173+
h|[[quarkus-hibernate-orm_section_quarkus-hibernate-orm-flush]] [.section-name.section-level0]##Flush configuration##
1174+
h|Type
1175+
h|Default
1176+
1177+
a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-flush-mode]] [.property-path]##`quarkus.hibernate-orm.flush.mode`##
1178+
1179+
`quarkus.hibernate-orm."persistence-unit-name".flush.mode`
1180+
1181+
[.description]
1182+
--
1183+
The default flushing strategy, or when to flush entities to the database in a Hibernate session:
1184+
before every query, on commit, ...
1185+
1186+
This default can be overridden on a per-session basis with `Session#setHibernateFlushMode()`
1187+
or on a per-query basis with the hint `HibernateHints#HINT_FLUSH_MODE`.
1188+
1189+
See the javadoc of `org.hibernate.FlushMode` for details.
1190+
1191+
1192+
ifdef::add-copy-button-to-env-var[]
1193+
Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_FLUSH_MODE+++[]
1194+
endif::add-copy-button-to-env-var[]
1195+
ifndef::add-copy-button-to-env-var[]
1196+
Environment variable: `+++QUARKUS_HIBERNATE_ORM_FLUSH_MODE+++`
1197+
endif::add-copy-button-to-env-var[]
1198+
--
1199+
a|`manual`, `commit`, `auto`, `always`
1200+
|`auto`
1201+
1202+
11731203
|===
11741204

11751205
ifndef::no-duration-note[]

_generated-doc/main/config/quarkus-hibernate-orm_quarkus.hibernate-orm.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,36 @@ endif::add-copy-button-to-env-var[]
11701170
|
11711171

11721172

1173+
h|[[quarkus-hibernate-orm_section_quarkus-hibernate-orm-flush]] [.section-name.section-level0]##Flush configuration##
1174+
h|Type
1175+
h|Default
1176+
1177+
a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-flush-mode]] [.property-path]##`quarkus.hibernate-orm.flush.mode`##
1178+
1179+
`quarkus.hibernate-orm."persistence-unit-name".flush.mode`
1180+
1181+
[.description]
1182+
--
1183+
The default flushing strategy, or when to flush entities to the database in a Hibernate session:
1184+
before every query, on commit, ...
1185+
1186+
This default can be overridden on a per-session basis with `Session#setHibernateFlushMode()`
1187+
or on a per-query basis with the hint `HibernateHints#HINT_FLUSH_MODE`.
1188+
1189+
See the javadoc of `org.hibernate.FlushMode` for details.
1190+
1191+
1192+
ifdef::add-copy-button-to-env-var[]
1193+
Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_FLUSH_MODE+++[]
1194+
endif::add-copy-button-to-env-var[]
1195+
ifndef::add-copy-button-to-env-var[]
1196+
Environment variable: `+++QUARKUS_HIBERNATE_ORM_FLUSH_MODE+++`
1197+
endif::add-copy-button-to-env-var[]
1198+
--
1199+
a|`manual`, `commit`, `auto`, `always`
1200+
|`auto`
1201+
1202+
11731203
|===
11741204

11751205
ifndef::no-duration-note[]

_versions/main/guides/datasource.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ quarkus.datasource.reactive.max-size=20
128128
The following section describes the configuration for single or multiple datasources.
129129
For simplicity, we will reference a single datasource as the default (unnamed) datasource.
130130

131+
[[configure-a-single-datasource]]
131132
=== Configure a single datasource
132133

133134
A datasource can be either a JDBC datasource, reactive, or both.

_versions/main/guides/hibernate-orm.adoc

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -584,17 +584,29 @@ public class MyProducer {
584584
[[persistence-xml]]
585585
== Setting up and configuring Hibernate ORM with a `persistence.xml`
586586

587-
Alternatively, you can use a `META-INF/persistence.xml` to set up Hibernate ORM.
588-
This is useful for:
587+
To set up and configure Hibernate ORM, <<hibernate-configuration-properties,using `application.properties`>> is recommended,
588+
but you can alternatively use a `META-INF/persistence.xml` file.
589+
This is mainly useful for migrating existing code to Quarkus.
589590

590-
* migrating existing code
591-
* when you have relatively complex settings requiring the full flexibility of the configuration
592-
* or if you like it the good old way
593-
594-
[NOTE]
591+
[WARNING]
595592
====
596-
If you use a `persistence.xml`, then you cannot use the `quarkus.hibernate-orm.*` properties
597-
and only persistence units defined in `persistence.xml` will be taken into account.
593+
Using a `persistence.xml` file implies a few constraints:
594+
595+
* Persistence units defined in `persistence.xml` always use the xref:datasource.adoc#configure-a-single-datasource[default datasource].
596+
* Persistence units defined in `persistence.xml` must be configured explicitly:
597+
Quarkus will keep injection of environment-related configuration to a minimum.
598+
+
599+
In particular, Quarkus will not configure the dialect or database version automatically based on the datasource,
600+
so if the default configuration of Hibernate ORM doesn't suit your needs,
601+
you will need to include in `persistence.xml` configuration such as
602+
link:{hibernate-orm-docs-url}#settings-hibernate.dialect[`hibernate.dialect`]/link:{hibernate-orm-docs-url}#settings-jakarta.persistence.database-product-name[`jakarta.persistence.database-product-name`]
603+
and possibly link:{hibernate-orm-docs-url}#settings-jakarta.persistence.database-product-version[`jakarta.persistence.database-product-version`].
604+
* Using `persistence.xml` is incompatible with using `quarkus.hibernate-orm.*` properties in `{config-file}`:
605+
if you mix them, Quarkus will raise an exception.
606+
* Developer experience may be impacted negatively when using `persistence.xml`
607+
compared to when <<hibernate-configuration-properties,using `application.properties`>>,
608+
due to unavailable features, limited guidance in the Quarkus documentation,
609+
and error messages providing resolution hints that cannot be applied (e.g. using `quarkus.hibernate-orm.*` properties).
598610
599611
If your classpath contains a `persistence.xml` that you want to ignore,
600612
set the following configuration property:
@@ -1395,6 +1407,9 @@ and annotating the implementation with the appropriate qualifiers:
13951407

13961408
[source,java]
13971409
----
1410+
import io.quarkus.hibernate.orm.JsonFormat;
1411+
import org.hibernate.type.format.FormatMapper;
1412+
13981413
@JsonFormat // <1>
13991414
@PersistenceUnitExtension // <2>
14001415
public class MyJsonFormatMapper implements FormatMapper { // <3>
@@ -1412,6 +1427,9 @@ public class MyJsonFormatMapper implements FormatMapper { // <3>
14121427
<1> Annotate the format mapper implementation with the `@JsonFormat` qualifier
14131428
to tell Quarkus that this mapper is specific to JSON serialization/deserialization.
14141429
+
1430+
WARNING: Make sure the Quarkus-specific `@io.quarkus.hibernate.orm.JsonFormat` annotation is used
1431+
and not the one from Jackson.
1432+
+
14151433
<2> Annotate the format mapper implementation with the `@PersistenceUnitExtension` qualifier
14161434
to tell Quarkus it should be used in the default persistence unit.
14171435
+
@@ -1422,6 +1440,9 @@ In case of a custom XML format mapper, a different CDI qualifier must be applied
14221440

14231441
[source,java]
14241442
----
1443+
import io.quarkus.hibernate.orm.XmlFormat;
1444+
import org.hibernate.type.format.FormatMapper;
1445+
14251446
@XmlFormat // <1>
14261447
@PersistenceUnitExtension // <2>
14271448
public class MyJsonFormatMapper implements FormatMapper { // <3>

_versions/main/guides/security-openid-connect-client-registration.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,6 @@ public class CustomTenantConfigResolver implements TenantConfigResolver {
233233

234234
Alternatively, you can use `OidcClientRegistrations` to prepare a new `OidcClientRegistration` and use `OidcClientRegistration` to register a client. For example:
235235

236-
The above configuration is sufficient for registering new clients using this configuration. For example:
237-
238236
[source,java]
239237
----
240238
package io.quarkus.it.keycloak;

0 commit comments

Comments
 (0)