Skip to content

Commit

Permalink
Refreshes persistence.adoc for Helidon 4.x (#7834)
Browse files Browse the repository at this point in the history
Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
  • Loading branch information
ljnelson authored Oct 18, 2023
1 parent 0deab9f commit ab91372
Showing 1 changed file with 23 additions and 36 deletions.
59 changes: 23 additions & 36 deletions docs/mp/persistence.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ How you set up Helidon MP's named data source integration differs
depending on which of these two connection pools, which JDBC driver,
and which relational database product you use.
Representative setups are described below. The list of such setups is
not exhaustive.
Representative setups are described below. This list of setups is not
exhaustive.
=== Project Setup [[DS-Setup]]
Expand Down Expand Up @@ -171,10 +171,10 @@ managed]
===== Overview
Regardless of which connection pool you use, at the lowest level JDBC
database driver classes are responsible for making any connections to
a relational database. JDBC database driver classes are
database-product-specific.
Regardless of which connection pool you use, at the lowest level, JDBC
database driver classes are what is ultimately responsible for making
any connections to a relational database. JDBC database driver
classes are database-product-specific.
Once you have decided upon a relational database product to use, and
JDBC driver classes to use to connect to it,
Expand All @@ -187,8 +187,8 @@ See the
link:{jdk-javadoc-url}/java.sql/java/sql/package-summary.html[JDBC 4.3
Specification] for more information about JDBC.
Representative setups are described below. The list of such setups is
not exhaustive.
Representative setups are described below. This list of setups is not
exhaustive.
===== Setting Up H2 [[DS-H2-Driver-Project-Setup]]
Expand Down Expand Up @@ -296,8 +296,8 @@ typically supply:
* Information required for the vendor-supplied `DataSource` to
authenticate to the database and otherwise tailor itself to it
Some examples for representative configurations follow. The list of
such configurations is not exhaustive.
Some examples for representative configurations follow. This list of
configurations is not exhaustive.
==== Configuration Prefixes [[DS-Configuration-Prefixes]]
Expand Down Expand Up @@ -857,8 +857,9 @@ details below for the JPA provider you have chosen to use.
To generate and compile the Jakarta Persistence static metamodel for
your application, regardless of whether you are using Hibernate ORM or
Eclipselink, make sure the `<plugin>` element in the following code
snippet is present as a child element of the
Eclipselink, xref:../about/managing-dependencies.adoc[ensure your
dependencies are managed], and then make sure the `<plugin>` element
in the following code snippet is present as a child element of the
`<pluginManagement><plugins>` element sequence as shown below:
[source,xml]
Expand All @@ -878,7 +879,7 @@ snippet is present as a child element of the
<annotationProcessorPath>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-jpamodelgen</artifactId> <!--1-->
<version>6.1.1.Final</version> <!--2-->
<version>${version.lib.hibernate}</version> <!--2-->
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
Expand All @@ -896,10 +897,9 @@ snippet is present as a child element of the
annotation processor that generates the static metamodel source
code], to the Java compiler's annotation processor path so that it
is active at compile time.
<2> Always check
https://search.maven.org/artifact/org.hibernate.orm/hibernate-jpamodelgen[Maven
Central] for up to date versions and make sure the version used is
that of Hibernate ORM itself.
<2> Because your xref:../about/managing-dependencies.adoc[dependencies
are managed], this will resolve to the currently supported version
of Hibernate ORM.
For more on the Hibernate ORM `hibernate-jpamodelgen` annotation
processor, see
Expand Down Expand Up @@ -959,7 +959,7 @@ project's `pom.xml` file's `<plugins>` element:
for up-to-date versions, and make sure the version is the same
as that of Hibernate ORM itself.
-->
<!-- <version>6.1.1.Final</version> -->
<!-- <version>6.3.1.Final</version> -->
<executions>
<execution>
<id>Statically enhance JPA entities for Hibernate</id>
Expand All @@ -977,20 +977,6 @@ project's `pom.xml` file's `<plugins>` element:
</plugin>
----
You must also
https://docs.jboss.org/hibernate/orm/6.1/userguide/html_single/Hibernate_User_Guide.html#appendix-legacy-bootstrap:~:text=Place%20a%20file%20named%20hibernate.properties%20in%20a%20root%20directory%20of%20the%20classpath[add
a file named `src/main/resources/META-INF/hibernate.properties`] with
the following line as its sole contents:
.`src/main/resources/META-INF/hibernate.properties`
[source,properties]
----
hibernate.bytecode.provider=none # <1>
----
<1> The value of `none` instructs Hibernate ORM to
link:{hibernate-javadoc-base-url}/org/hibernate/cfg/Environment.html#BYTECODE_PROVIDER_NAME_NONE[not
attempt to perform weaving at runtime].
For more on the `hibernate-enhance-maven-plugin` in particular, see
link:{hibernate-doc-jboss-url}/userguide/html_single/Hibernate_User_Guide.html#tooling-maven[its
documentation].
Expand Down Expand Up @@ -1144,16 +1130,16 @@ Your `META-INF/persistence.xml` file must begin
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence
https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
version="3.0"> <!--1-->
https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
version="3.1"> <!--1-->
<!--2-->
</persistence>
----
<1> Helidon MP's Jakarta Persistence integration supports
link:{jakarta-persistence-base-url}/[Jakarta Persistence version
3.0].
3.1].
<2> `<persistence-unit> elements are listed here.
==== Persistence Unit
Expand Down Expand Up @@ -1363,7 +1349,8 @@ Property Extensions Reference] in the Eclipselink documentation.
To use Helidon MP's Jakarta Persistence integration, once you have
<<JPA-Setup, set up>> and <<JPA-Configuration, configured>> your
project, you use the Jakarta Persistence APIs in almost the same
manner as if your project were deployed to a Jakarta EE server.
manner as if your project were deployed to a Jakarta EE application
server.
Specifically, you:
Expand Down

0 comments on commit ab91372

Please sign in to comment.