Skip to content

Commit

Permalink
ORM 7.0.0.Beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed Aug 1, 2024
1 parent 5daf463 commit 797a973
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public ReactiveDeferredResultSetAccess(
JdbcParameterBindings jdbcParameterBindings,
ExecutionContext executionContext,
Function<String, PreparedStatement> statementCreator) {
super( jdbcSelect, jdbcParameterBindings, executionContext, statementCreator );
super( jdbcSelect, jdbcParameterBindings, executionContext, statementCreator, -1 );
this.executionContext = executionContext;
this.sqlStatementLogger = executionContext.getSession().getJdbcServices().getSqlStatementLogger();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -171,15 +171,14 @@ 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;

@CurrentUser.LoggedUserMutinyAlways
public String updatedBy;

@Generated(GenerationTime.NEVER)
public String never;

public GeneratedRegular() {
Expand All @@ -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;

Expand All @@ -220,15 +219,14 @@ 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;

@CurrentUser.LoggedUserStageAlways
public String updatedBy;

@Generated(GenerationTime.NEVER)
public String never;

public GeneratedWithIdentity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -166,7 +166,6 @@ static class GeneratedRegular {
@CurrentUser.LoggedUserStageAlways
public String updatedBy;

@Generated(GenerationTime.NEVER)
public String never;

public GeneratedRegular() {
Expand All @@ -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;
Expand All @@ -205,7 +204,6 @@ static class GeneratedWithIdentity {
@CurrentUser.LoggedUserStageAlways
public String updatedBy;

@Generated(GenerationTime.NEVER)
public String never;

public GeneratedWithIdentity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -130,15 +130,14 @@ 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;

@CurrentUser.LoggedUserStageAlways
public String updatedBy;

@Generated(GenerationTime.NEVER)
public String never;

public GeneratedRegular() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;

Expand Down

0 comments on commit 797a973

Please sign in to comment.