Skip to content

Commit

Permalink
move to hibernate 6.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Aug 9, 2023
1 parent 9de6d7b commit 32f1533
Show file tree
Hide file tree
Showing 15 changed files with 213 additions and 221 deletions.
100 changes: 50 additions & 50 deletions generators/docker-compose/__snapshots__/docker-compose.spec.mts.snap

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions generators/docker/__snapshots__/generator.spec.mts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:
- MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
- SPRING_CLOUD_CONSUL_HOST=consul
- SPRING_CLOUD_CONSUL_PORT=8500
- SPRING_R2DBC_URL=r2dbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false&serverTimezone=UTC
- SPRING_LIQUIBASE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false&serverTimezone=UTC
- SPRING_R2DBC_URL=r2dbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false
- SPRING_LIQUIBASE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false
- SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200
ports:
- 127.0.0.1:8080:8080
Expand Down Expand Up @@ -718,8 +718,8 @@ services:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=prod,api-docs
- MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
- SPRING_DATASOURCE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false&serverTimezone=UTC
- SPRING_LIQUIBASE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false&serverTimezone=UTC
- SPRING_DATASOURCE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false
- SPRING_LIQUIBASE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false
- SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka:9092
ports:
- 127.0.0.1:8080:8080
Expand Down Expand Up @@ -1192,8 +1192,8 @@ services:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=prod,api-docs
- MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/jhipster?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
- SPRING_LIQUIBASE_URL=jdbc:mysql://mysql:3306/jhipster?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/jhipster?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- SPRING_LIQUIBASE_URL=jdbc:mysql://mysql:3306/jhipster?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- JHIPSTER_CACHE_REDIS_SERVER=redis://redis:6379
- JHIPSTER_CACHE_REDIS_CLUSTER=false
- SPRING_PULSAR_CLIENT_SERVICE_URL=pulsar://pulsar:6650
Expand Down
2 changes: 1 addition & 1 deletion generators/generator-constants.mts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const javaDependencies: Record<string, string> = {
* Required due to hibernate-jpamodelgen annotation processor.
*/
// TODO update to spring-boot provided version. Refer to https://github.com/jhipster/generator-jhipster/issues/22579
hibernate: '6.1.7.Final', // Should be 6.2.5.Final
hibernate: '6.2.5.Final', // Should be 6.2.5.Final
/*
* cassandra driver version should match the one managed by https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/SPRING_BOOT_VERSION
* Required due to java-driver-mapper-processor annotation processor.
Expand Down

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions generators/kubernetes-knative/__snapshots__/knative.spec.mts.snap

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions generators/kubernetes/__snapshots__/kubernetes.spec.mts.snap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -285,7 +285,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -449,7 +449,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -723,7 +723,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -902,7 +902,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -1456,7 +1456,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -1536,7 +1536,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down Expand Up @@ -1617,7 +1617,7 @@ ROLE_USER
<property name="now" value="now()" dbms="h2"/>
<property name="floatType" value="float4" dbms="h2"/>
<property name="uuidType" value="uuid" dbms="h2"/>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<property name="clobType" value="longvarchar" dbms="h2"/>
<property name="blobType" value="blob" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%_ } else { _%>
<property name="uuidType" value="uuid" dbms="h2"/>
<%_ } _%>
<property name="datetimeType" value="datetime" dbms="h2"/>
<property name="datetimeType" value="datetime(6)" dbms="h2"/>
<%_ if (prodDatabaseTypePostgres) { _%>
<property name="clobType" value="longvarchar" dbms="h2"/>
<%_ } else { _%>
Expand Down
16 changes: 8 additions & 8 deletions generators/openshift/__snapshots__/openshift.spec.mts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -436,7 +436,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -1149,7 +1149,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -1738,7 +1738,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mariadb://\${APPLICATION_NAME}-mariadb:3306/msmariadb?useLegacyDatetimeCode=false&serverTimezone=UTC
value: jdbc:mariadb://\${APPLICATION_NAME}-mariadb:3306/msmariadb?useLegacyDatetimeCode=false
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -2371,7 +2371,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -3557,7 +3557,7 @@ objects:
- name: JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET
value: YlhrdGMyVmpjbVYwTFhSdmEyVnVMWFJ2TFdOb1lXNW5aUzFwYmkxd2NtOWtkV04wYVc5dUxXRnVaQzEwYnkxclpXVndMV2x1TFdFdGMyVmpkWEpsTFhCc1lXTmwK
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/samplemysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/samplemysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -4008,7 +4008,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -4705,7 +4705,7 @@ objects:
- name: SPRING_CLOUD_CONSUL_PORT
value: 8500
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
value: jdbc:mysql://\${APPLICATION_NAME}-mysqldb:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ spring:
open-in-view: false
properties:
hibernate.jdbc.time_zone: UTC
hibernate.timezone.default_storage: NORMALIZE
hibernate.type.preferred_instant_jdbc_type: TIMESTAMP
hibernate.id.new_generator_mappings: true
hibernate.connection.provider_disables_autocommit: true
Expand Down
5 changes: 2 additions & 3 deletions generators/spring-data-relational/support/database-data.mts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const databaseData: Record<string, DatabaseDataSpec> = {
jdbcDriver: 'org.mariadb.jdbc.Driver',
hibernateDialect: 'org.hibernate.dialect.MariaDB103Dialect',
port: ':3306/',
extraOptions: '?useLegacyDatetimeCode=false&serverTimezone=UTC',
extraOptions: '?useLegacyDatetimeCode=false',
defaultUsername: 'root',

constraintNameMaxLength: 64,
Expand All @@ -125,8 +125,7 @@ const databaseData: Record<string, DatabaseDataSpec> = {
tableNameMaxLength: 64,
constraintNameMaxLength: 64,
port: ':3306/',
extraOptions:
'?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true',
extraOptions: '?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true',
defaultUsername: 'root',
},
[ORACLE]: {
Expand Down
16 changes: 8 additions & 8 deletions generators/spring-data-relational/support/database-url.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const { H2_MEMORY, H2_DISK, MARIADB, MSSQL, MYSQL, ORACLE, POSTGRESQL } = databa
describe('generator - sql - database-url', () => {
describe('getJdbcUrl', () => {
describe('when called for mysql', () => {
it('return jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true', () => {
it('return jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true', () => {
expect(getJdbcUrl(MYSQL, { databaseName: 'test', hostname: 'localhost' })).toEqual(
'jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true',
'jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true',
);
});
});
Expand All @@ -21,9 +21,9 @@ describe('generator - sql - database-url', () => {
});
});
describe('when called for mariadb', () => {
it('return jdbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false&serverTimezone=UTC', () => {
it('return jdbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false', () => {
expect(getJdbcUrl(MARIADB, { databaseName: 'test', hostname: 'localhost' })).toEqual(
'jdbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false&serverTimezone=UTC',
'jdbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false',
);
});
});
Expand Down Expand Up @@ -131,9 +131,9 @@ describe('generator - sql - database-url', () => {

describe('getR2dbcUrl', () => {
describe('when called for mysql', () => {
it('return r2dbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true', () => {
it('return r2dbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true', () => {
expect(getR2dbcUrl(MYSQL, { databaseName: 'test', hostname: 'localhost' })).toEqual(
'r2dbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true',
'r2dbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true',
);
});
});
Expand All @@ -145,9 +145,9 @@ describe('generator - sql - database-url', () => {
});
});
describe('when called for mariadb', () => {
it('return r2dbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false&serverTimezone=UTC', () => {
it('return r2dbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false', () => {
expect(getR2dbcUrl(MARIADB, { databaseName: 'test', hostname: 'localhost' })).toEqual(
'r2dbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false&serverTimezone=UTC',
'r2dbc:mariadb://localhost:3306/test?useLegacyDatetimeCode=false',
);
});
});
Expand Down
Loading

0 comments on commit 32f1533

Please sign in to comment.