Hello Hibernate Team,
I was updating our SpringBoot version from 2.x to 3.x, and I am having trouble with starting our app. I created the tables by using liquibase in the past. When I start my application I see the below exception.
{code:java} Suppressed: java.lang.UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements as well at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:123) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final] at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:107) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final] at org.hibernate.dialect.PostgreSQLDialect.getFallbackSqmInsertStrategy(PostgreSQLDialect.java:828) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]{code}
One of my entites looks like the following;
{noformat}import com.fasterxml.jackson.annotation.JsonIgnore; import java.time.OffsetDateTime; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.hibernate.annotations.UpdateTimestamp; import org.hibernate.envers.Audited;
@Data @Entity @Builder @NoArgsConstructor @AllArgsConstructor @Audited public class PaymentAccount { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "payment_account_seq") @GenericGenerator( name = "payment_account_seq", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = {@Parameter(name = "sequence_name", value = "payment_account_seq")}) @JsonIgnore private Long id;
private String ciamId;
private String providerName;
private String providerUserId;
@CreationTimestamp @Column(updatable = false) private OffsetDateTime createdAt;
@UpdateTimestamp private OffsetDateTime updatedAt; } {noformat}
I couldn’t be sure what is causing this issue. I would appreciate if you can help me solve it. You can find the configuration I use below.
* hibernate-envers: 6.1.7.Final * hibernate-core: 6.1.7.Final * hibernate-commons-annotations:6.0.6.Final * spring-boot-starter-data-jpa:3.0.6 * postgresql jdbc driver:42.5.4 * postgres 14
{noformat} datasource: url: jdbc:postgresql://localhost:8086/mydb username: admin password: admin driver-class-name: org.postgresql.Driver hikari: maximum-pool-size: 12 idle-timeout: 60000 pool-name: BackendHikariPool connection-timeout: 45000 minimum-idle: 1 connection-test-query: SELECT 1 type: com.zaxxer.hikari.HikariDataSource jpa: show-sql: false open-in-view: false hibernate: ddl-auto: none properties: org.hibernate.envers.do_not_audit_optimistic_locking_field: false hibernate: namingStrategy: org.hibernate.cfg.ImprovedNamingStrategy dialect: org.hibernate.dialect.PostgreSQLDialect hbm2ddl: auto: none temp: use_jdbc_metadata_defaults: false sql: init: continue-on-error: true platform: org.hibernate.dialect.PostgreSQLDialect{noformat} |
|