From 797a973cff22d51ff551379569fdea37bb669368 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 1 Aug 2024 10:32:49 -0500 Subject: [PATCH] ORM 7.0.0.Beta1 --- build.gradle | 2 +- gradle.properties | 4 ++-- .../internal/ReactiveDeferredResultSetAccess.java | 2 +- .../reactive/GeneratedPropertyJoinedTableTest.java | 12 +++++------- .../reactive/GeneratedPropertySingleTableTest.java | 12 +++++------- .../GeneratedPropertyUnionSubclassesTest.java | 7 +++---- .../org/hibernate/reactive/it/lazytoone/Ship.java | 4 ---- 7 files changed, 17 insertions(+), 26 deletions(-) diff --git a/build.gradle b/build.gradle index e41caee5d..7d61c8f2a 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ version = projectVersion // ./gradlew clean build -PhibernateOrmVersion=5.6.15-SNAPSHOT ext { if ( !project.hasProperty('hibernateOrmVersion') ) { - hibernateOrmVersion = '7.0.0.Alpha2' + hibernateOrmVersion = '7.0.0.Beta1' } if ( !project.hasProperty( 'hibernateOrmGradlePluginVersion' ) ) { // Same as ORM as default diff --git a/gradle.properties b/gradle.properties index 03ced0e11..92d1ad3a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,12 +35,12 @@ org.gradle.java.installations.auto-download=false enableMavenLocalRepo = true # Override default Hibernate ORM version -hibernateOrmVersion = 7.0.0-SNAPSHOT +#hibernateOrmVersion = 7.0.0-SNAPSHOT # Override default Hibernate ORM Gradle plugin version # Using the stable version because I don't know how to configure the build to download the snapshot version from # a remote repository -hibernateOrmGradlePluginVersion = 7.0.0.Alpha2 +#hibernateOrmGradlePluginVersion = 7.0.0.Alpha2 # If set to true, skip Hibernate ORM version parsing (default is true, if set to null) # this is required when using intervals or weird versions or the build will fail diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java index 09a2afaa2..0df8ef1c0 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java @@ -59,7 +59,7 @@ public ReactiveDeferredResultSetAccess( JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, Function statementCreator) { - super( jdbcSelect, jdbcParameterBindings, executionContext, statementCreator ); + super( jdbcSelect, jdbcParameterBindings, executionContext, statementCreator, -1 ); this.executionContext = executionContext; this.sqlStatementLogger = executionContext.getSession().getJdbcServices().getSqlStatementLogger(); } diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyJoinedTableTest.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyJoinedTableTest.java index 018936ad5..879574b18 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyJoinedTableTest.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyJoinedTableTest.java @@ -11,9 +11,9 @@ import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.Generated; -import org.hibernate.annotations.GenerationTime; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; +import org.hibernate.generator.EventType; import org.hibernate.reactive.annotations.DisabledFor; import org.junit.jupiter.api.Test; @@ -152,7 +152,7 @@ static class GeneratedRegularParent { public String lastname; - @Generated(GenerationTime.ALWAYS) + @Generated( event = {EventType.INSERT, EventType.UPDATE} ) @Column(columnDefinition = "varchar(600) generated always as (firstname || ' ' || lastname) stored") public String fullName; @@ -171,7 +171,7 @@ public GeneratedRegularParent(String firstname, String lastname) { @Entity(name = "GeneratedRegular") static class GeneratedRegular extends GeneratedRegularParent { @Temporal(value = TemporalType.TIMESTAMP) - @Generated(GenerationTime.INSERT) + @Generated( event = {EventType.INSERT} ) @Column(columnDefinition = "timestamp") @ColumnDefault("current_timestamp") public Date createdAt; @@ -179,7 +179,6 @@ static class GeneratedRegular extends GeneratedRegularParent { @CurrentUser.LoggedUserMutinyAlways public String updatedBy; - @Generated(GenerationTime.NEVER) public String never; public GeneratedRegular() { @@ -201,7 +200,7 @@ static class GeneratedWithIdentityParent { public String lastname; - @Generated(GenerationTime.ALWAYS) + @Generated( event = {EventType.INSERT, EventType.UPDATE} ) @Column(columnDefinition = "varchar(600) generated always as (firstname || ' ' || lastname) stored") public String fullName; @@ -220,7 +219,7 @@ public GeneratedWithIdentityParent(String firstname, String lastname) { @Entity(name = "GeneratedWithIdentity") static class GeneratedWithIdentity extends GeneratedWithIdentityParent { @Temporal(value = TemporalType.TIMESTAMP) - @Generated(GenerationTime.INSERT) + @Generated( event = {EventType.INSERT} ) @Column(columnDefinition = "timestamp") @ColumnDefault("current_timestamp") public Date createdAt; @@ -228,7 +227,6 @@ static class GeneratedWithIdentity extends GeneratedWithIdentityParent { @CurrentUser.LoggedUserStageAlways public String updatedBy; - @Generated(GenerationTime.NEVER) public String never; public GeneratedWithIdentity() { diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertySingleTableTest.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertySingleTableTest.java index 60b23a563..deac05216 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertySingleTableTest.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertySingleTableTest.java @@ -11,9 +11,9 @@ import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.Generated; -import org.hibernate.annotations.GenerationTime; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; +import org.hibernate.generator.EventType; import org.hibernate.reactive.annotations.DisabledFor; import org.junit.jupiter.api.Test; @@ -150,12 +150,12 @@ static class GeneratedRegular { public String lastname; - @Generated(GenerationTime.ALWAYS) + @Generated( event = { EventType.INSERT, EventType.UPDATE} ) @Column(columnDefinition = "varchar(600) generated always as (firstname || ' ' || lastname) stored") private String fullName; @Temporal(value = TemporalType.TIMESTAMP) - @Generated(GenerationTime.INSERT) + @Generated( event = {EventType.INSERT} ) @Column(columnDefinition = "timestamp") @ColumnDefault("current_timestamp") public Date createdAt; @@ -166,7 +166,6 @@ static class GeneratedRegular { @CurrentUser.LoggedUserStageAlways public String updatedBy; - @Generated(GenerationTime.NEVER) public String never; public GeneratedRegular() { @@ -189,12 +188,12 @@ static class GeneratedWithIdentity { public String lastname; - @Generated(GenerationTime.ALWAYS) + @Generated( event = {EventType.INSERT, EventType.UPDATE} ) @Column(columnDefinition = "varchar(600) generated always as (firstname || ' ' || lastname) stored") private String fullName; @Temporal(value = TemporalType.TIMESTAMP) - @Generated(GenerationTime.INSERT) + @Generated( event = {EventType.INSERT} ) @Column(columnDefinition = "timestamp") @ColumnDefault("current_timestamp") public Date createdAt; @@ -205,7 +204,6 @@ static class GeneratedWithIdentity { @CurrentUser.LoggedUserStageAlways public String updatedBy; - @Generated(GenerationTime.NEVER) public String never; public GeneratedWithIdentity() { diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyUnionSubclassesTest.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyUnionSubclassesTest.java index b024372a8..f2b4ecdfe 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyUnionSubclassesTest.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/GeneratedPropertyUnionSubclassesTest.java @@ -11,9 +11,9 @@ import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.Generated; -import org.hibernate.annotations.GenerationTime; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; +import org.hibernate.generator.EventType; import org.hibernate.reactive.annotations.DisabledFor; import org.junit.jupiter.api.Test; @@ -111,7 +111,7 @@ static class GeneratedRegularParent { public String lastname; - @Generated(GenerationTime.ALWAYS) + @Generated( event = {EventType.INSERT, EventType.UPDATE} ) @Column(columnDefinition = "varchar(600) generated always as (firstname || ' ' || lastname) stored") public String fullName; @@ -130,7 +130,7 @@ public GeneratedRegularParent(String firstname, String lastname) { @Entity(name = "GeneratedRegular") static class GeneratedRegular extends GeneratedRegularParent { @Temporal(value = TemporalType.TIMESTAMP) - @Generated(GenerationTime.INSERT) + @Generated( event = EventType.INSERT ) @Column(columnDefinition = "timestamp") @ColumnDefault("current_timestamp") public Date createdAt; @@ -138,7 +138,6 @@ static class GeneratedRegular extends GeneratedRegularParent { @CurrentUser.LoggedUserStageAlways public String updatedBy; - @Generated(GenerationTime.NEVER) public String never; public GeneratedRegular() { diff --git a/integration-tests/bytecode-enhancements-it/src/main/java/org/hibernate/reactive/it/lazytoone/Ship.java b/integration-tests/bytecode-enhancements-it/src/main/java/org/hibernate/reactive/it/lazytoone/Ship.java index 60bf2a278..11ed5a200 100644 --- a/integration-tests/bytecode-enhancements-it/src/main/java/org/hibernate/reactive/it/lazytoone/Ship.java +++ b/integration-tests/bytecode-enhancements-it/src/main/java/org/hibernate/reactive/it/lazytoone/Ship.java @@ -15,9 +15,6 @@ import jakarta.persistence.OneToOne; import jakarta.persistence.Table; -import org.hibernate.annotations.LazyToOne; -import org.hibernate.annotations.LazyToOneOption; - @Entity(name = "Ship") @Table(name = "Ship") public class Ship { @@ -30,7 +27,6 @@ public class Ship { @Basic(fetch = FetchType.LAZY) private byte[] picture; - @LazyToOne(LazyToOneOption.NO_PROXY) @OneToOne(fetch = FetchType.LAZY, mappedBy = "ship", cascade = CascadeType.ALL) private Captain captain;