Skip to content

Commit b0be548

Browse files
committed
Merge remote-tracking branch 'upstream/main' into main-perf
2 parents 45e3f38 + 15873c1 commit b0be548

File tree

1,064 files changed

+42241
-11298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,064 files changed

+42241
-11298
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ updates:
1414
- gradle-plugin-portal
1515
schedule:
1616
interval: "weekly"
17+
- package-ecosystem: github-actions
18+
directory: "/"
19+
schedule:
20+
interval: daily

.github/workflows/contributor-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
# Running with HANA requires at least 8GB memory just for the database, which we don't have on GH Actions runners
5252
# - rdbms: hana
5353
steps:
54-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
5555
with:
5656
persist-credentials: false
5757
- name: Reclaim Disk Space
@@ -61,7 +61,7 @@ jobs:
6161
RDBMS: ${{ matrix.rdbms }}
6262
run: ci/database-start.sh
6363
- name: Set up Java 11
64-
uses: actions/setup-java@v2
64+
uses: actions/setup-java@v3
6565
with:
6666
distribution: 'temurin'
6767
java-version: '11'
@@ -70,7 +70,7 @@ jobs:
7070
run: echo "yearmonth=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
7171
shell: bash
7272
- name: Cache Maven local repository
73-
uses: actions/cache@v2
73+
uses: actions/cache@v3
7474
id: cache-maven
7575
with:
7676
path: |
@@ -85,7 +85,7 @@ jobs:
8585
run: ./ci/build-github.sh
8686
shell: bash
8787
- name: Upload test reports (if Gradle failed)
88-
uses: actions/upload-artifact@v2
88+
uses: actions/upload-artifact@v3
8989
if: failure()
9090
with:
9191
name: test-reports-java11-${{ matrix.rdbms }}

ci/jpa-3.1-tck.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pipeline {
2121
}
2222
parameters {
2323
choice(name: 'IMAGE_JDK', choices: ['jdk11'], description: 'The JDK base image version to use for the TCK image.')
24-
string(name: 'TCK_VERSION', defaultValue: '3.1.1', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
25-
string(name: 'TCK_SHA', defaultValue: 'b954b39440b331eb4584187d2d8245f82c4d2aa8b02d2e04bd42498a5751312b', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
24+
string(name: 'TCK_VERSION', defaultValue: '3.1.2', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
25+
string(name: 'TCK_SHA', defaultValue: '618a9fcdb0f897cda71227ed57d035ae1dc40fc392318809a734ffc6968e43ff', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
2626
booleanParam(name: 'NO_SLEEP', defaultValue: true, description: 'Whether the NO_SLEEP patch should be applied to speed up the TCK execution')
2727
}
2828
stages {

design/doc-query-expressions.adoc

Lines changed: 0 additions & 33 deletions
This file was deleted.

design/doc-temporal.adoc

Lines changed: 0 additions & 10 deletions
This file was deleted.

design/working/fk.adoc renamed to design/fk.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Assuming bi-directionality, we have 2 `Association` refs:
3131
3232
3333
34-
There is a single ForeignKeyDescriptor instance for this FK in our metamodel, with 2 Sides:
34+
There is a single `ForeignKeyDescriptor` instance for this FK in our metamodel, with 2 Sides:
3535

3636
```
3737
ForeignKeyDescriptor (

design/sql-ast.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ The actual tree nodes are defined in the `org.hibernate.sql.ast.tree` package.
3030

3131
== Building SQL AST
3232

33-
There are 2 main producers of SQL AST atm:
33+
There are 3 main producers of SQL AST:
3434

35-
* SQM translation - see `org.hibernate.query.sqm.sql`
36-
* metamodel-based loading - see `org.hibernate.loader.internal.MetamodelSelectBuilderProcess`
35+
SQM:: Translation of HQL and criteria queries. See `org.hibernate.query.sqm.sql`
36+
Loading:: SQL generated for persistence-context events to load entities and collections. This includes `Session#find`, `Session#get`, `Session#lock`, ... See `org.hibernate.loader.internal.MetamodelSelectBuilderProcess`
37+
Mutations:: SQL generated for persistence-context flush events to write entity and collection state to the database. See `org.hibernate.persister.entity.mutation` and `org.hibernate.persister.collection.mutation`
3738

3839

3940
== Translating SQL AST

design/working/6.0-posts.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ from the removal of deprecated stuff. There are a few one-off changes that brea
3737
source compatibility; these are covered in the link:{migration-guide-url}[migration guide].
3838

3939
One specific change to note is that many of these contracts have been better defined with type
40-
parameters. Theses were inconsistently and sometimes poorly defined in previous versions.
40+
parameters. Theses were inconsistently (and sometimes poorly) defined in previous versions.
4141

4242
Quite a few SPI contracts have changed to support many of the topics discussed here as well as in
4343
the link:{migration-guide-url}[migration guide]. Many will also be the subject of the mentioned
@@ -267,4 +267,4 @@ For additional details, see:
267267
- the link:{migration-guide-url}[Migration Guide]
268268
- the https://hibernate.org/orm/releases/6.0/[release page].
269269

270-
To get in touch, use the usual channels as discussed on the https://hibernate.org/community/[website].
270+
To get in touch, use the usual channels as discussed on the https://hibernate.org/community/[website].

docker_db.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,33 @@ EOF
769769

770770
}
771771

772+
tidb() {
773+
tidb_5_1
774+
}
775+
776+
tidb_5_1() {
777+
$CONTAINER_CLI rm -f tidb || true
778+
$CONTAINER_CLI run --name tidb -p4000:4000 -d docker.io/pingcap/tidb:v5.1.4
779+
# Give the container some time to start
780+
OUTPUT=
781+
n=0
782+
until [ "$n" -ge 5 ]
783+
do
784+
OUTPUT=$($CONTAINER_CLI logs tidb 2>&1)
785+
if [[ $OUTPUT == *"server is running"* ]]; then
786+
break;
787+
fi
788+
n=$((n+1))
789+
echo "Waiting for TiDB to start..."
790+
sleep 3
791+
done
792+
if [ "$n" -ge 5 ]; then
793+
echo "TiDB failed to start and configure after 15 seconds"
794+
else
795+
echo "TiDB successfully started"
796+
fi
797+
}
798+
772799
if [ -z ${1} ]; then
773800
echo "No db name provided"
774801
echo "Provide one of:"
@@ -804,6 +831,8 @@ if [ -z ${1} ]; then
804831
echo -e "\tpostgresql_10"
805832
echo -e "\tpostgresql_9_5"
806833
echo -e "\tsybase"
834+
echo -e "\ttidb"
835+
echo -e "\ttidb_5_1"
807836
else
808837
${1}
809838
fi

documentation/documentation.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ asciidoctorj {
105105
options logDocuments: true
106106
}
107107

108-
109108
// Topical Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110109

111110
task renderTopicalGuides(type: AsciidoctorTask, group: 'Documentation') {task->
@@ -160,6 +159,10 @@ task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {task->
160159
tasks.buildDocs.dependsOn task
161160
tasks.buildDocsForPublishing.dependsOn task
162161

162+
dependsOn ':hibernate-core:collectConfigProperties'
163+
dependsOn ':hibernate-envers:collectConfigProperties'
164+
dependsOn ':hibernate-jcache:collectConfigProperties'
165+
163166
sourceDir = file( 'src/main/asciidoc/userguide' )
164167
sources {
165168
include 'Hibernate_User_Guide.adoc'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
== List of all available configuration properties
2+
3+
include::../../../../target/config-properties/hibernate-core.asciidoc[opts=optional]
4+
include::../../../../target/config-properties/hibernate-envers.asciidoc[opts=optional]
5+
include::../../../../target/config-properties/hibernate-jcache.asciidoc[opts=optional]

documentation/src/main/asciidoc/userguide/Hibernate_User_Guide.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Vlad Mihalcea, Steve Ebersole, Andrea Boriero, Gunnar Morling, Gail Badner, Chri
33
:toc2:
44
:toclevels: 3
55
:sectanchors:
6+
:root-project-dir: ../../../../../../..
7+
68

79
include::Preface.adoc[]
810

@@ -42,5 +44,6 @@ include::appendices/Legacy_DomainModel.adoc[]
4244
include::appendices/LegacyBasicTypeResolution.adoc[]
4345
include::appendices/Legacy_Native_Queries.adoc[]
4446

47+
include::ConfigPropertyList.adoc[]
4548
include::Bibliography.adoc[]
4649

documentation/src/main/asciidoc/userguide/appendices/Annotations.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,13 @@ The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibern
11841184

11851185
See the <<chapters/domain/embeddables.adoc#embeddable-Parent,`@Parent` mapping>> section for more info.
11861186

1187+
[[annotations-hibernate-partition-key]]
1188+
==== `@PartitionKey`
1189+
1190+
The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/annotations/PartitionKey.html[`@PartitionKey`] annotation is used to identify a field of an entity that holds the partition key of a table.
1191+
1192+
See the <<chapters/domain/embeddables.adoc#embeddable-Parent,`@PartitionKey` mapping>> section for more info.
1193+
11871194
[[annotations-hibernate-persister]]
11881195
==== `@Persister`
11891196

documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,23 @@ Assuming `hibernate.globally_quoted_identifiers` is `true`, this allows the glob
270270
Specifies whether to automatically quote any names that are deemed keywords.
271271

272272
==== Time zone storage
273-
`*hibernate.timezone.default_storage*` (e.g. `COLUMN`, `NATIVE`, `AUTO` or `NORMALIZE` (default value))::
273+
`*hibernate.timezone.default_storage*` (e.g. `COLUMN`, `NATIVE`, `NORMALIZE`, `NORMALIZE_UTC`, `AUTO` or `DEFAULT` (default value))::
274274
Global setting for configuring the default storage for the time zone information for time zone based types.
275275
+
276-
`NORMALIZE`::: Does not store the time zone information, and instead normalizes timestamps to UTC
277-
`COLUMN`::: Stores the time zone information in a separate column; works in conjunction with `@TimeZoneColumn`
278-
`NATIVE`::: Stores the time zone information by using the `with time zone` type. Error if `Dialect#getTimeZoneSupport()` is not `NATIVE`
276+
`NORMALIZE`:::
277+
Legacy behavior (Hibernate ORM 5).
278+
+
279+
Does not store the time zone information, and instead:
280+
+
281+
* when persisting to the database, normalizes JDBC timestamps to the
282+
<<jdbc-time-zone,JDBC timezone>> or to the JVM default time zone if not set.
283+
* when reading back from the database, sets the offset or zone
284+
of `OffsetDateTime`/`ZonedDateTime` values to the JVM default time zone.
285+
`NORMALIZE_UTC`::: Does not store the time zone information, and instead normalizes timestamps to UTC.
286+
`COLUMN`::: Stores the time zone information in a separate column; works in conjunction with `@TimeZoneColumn`.
287+
`NATIVE`::: Stores the time zone information by using the `with time zone` type. Error if `Dialect#getTimeZoneSupport()` is not `NATIVE`.
279288
`AUTO`::: Stores the time zone information either with `NATIVE` if `Dialect#getTimeZoneSupport()` is `NATIVE`, otherwise uses the `COLUMN` strategy.
289+
`DEFAULT`::: Stores the time zone information either with `NATIVE` if `Dialect#getTimeZoneSupport()` is `NATIVE`, otherwise uses the `NORMALIZE_UTC` strategy.
280290
+
281291
The default value is given by the {@link org.hibernate.annotations.TimeZoneStorageType#NORMALIZE},
282292
meaning that time zone information is not stored by default, but timestamps are normalized instead.
@@ -374,7 +384,9 @@ Enable nationalized character support on all string / clob based attribute ( str
374384
`*hibernate.jdbc.lob.non_contextual_creation*` (e.g. `true` or `false` (default value))::
375385
Should we not use contextual LOB creation (aka based on `java.sql.Connection#createBlob()` et al)? The default value for HANA, H2, and PostgreSQL is `true`.
376386

377-
`*hibernate.jdbc.time_zone*` (e.g. A `java.util.TimeZone`, a `java.time.ZoneId` or a `String` representation of a `ZoneId`)::
387+
[[jdbc-time-zone]]`*hibernate.jdbc.time_zone*` (e.g. A `java.util.TimeZone`, a `java.time.ZoneId` or a `String` representation of a `ZoneId`)::
388+
The timezone to use in the JDBC driver, which is supposed to match the database timezone.
389+
+
378390
Unless specified, the JDBC Driver uses the default JVM time zone. If a different time zone is configured via this setting, the JDBC https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html#setTimestamp-int-java.sql.Timestamp-java.util.Calendar-[PreparedStatement#setTimestamp] is going to use a `Calendar` instance according to the specified time zone.
379391

380392
`*hibernate.dialect.oracle.prefer_long_raw*` (e.g. `true` or `false` (default value))::
@@ -790,10 +802,7 @@ The default behavior is to allow access unless the `Session` is bootstrapped via
790802
[[configurations-multi-tenancy]]
791803
=== Multi-tenancy settings
792804

793-
`*hibernate.multiTenancy*` (e.g. `NONE` (default value), `SCHEMA`, `DATABASE`, and `DISCRIMINATOR` (not implemented yet))::
794-
The multi-tenancy strategy in use.
795-
796-
`*hibernate.multi_tenant_connection_provider*` (e.g. `true` or `false` (default value))::
805+
`*hibernate.multi_tenant_connection_provider*`::
797806
Names a https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/engine/jdbc/connections/spi/MultiTenantConnectionProvider.html[`MultiTenantConnectionProvider`] implementation to use. As `MultiTenantConnectionProvider` is also a service, can be configured directly through the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/boot/registry/StandardServiceRegistryBuilder.html[`StandardServiceRegistryBuilder`].
798807

799808
`*hibernate.tenant_identifier_resolver*`::

0 commit comments

Comments
 (0)