From 915c8b8ead03a3f15c89dee1c1ec208e8948dd88 Mon Sep 17 00:00:00 2001 From: Vincent Bouthinon Date: Thu, 21 Mar 2024 11:32:02 +0100 Subject: [PATCH] HHH-17871 Error if defining a ManyToAny in the child classes which references a @MappedSuperclass Rename column "ROLE" to "ROLE_COL" for a problem with sybase --- .../ManyToAnySubClassAccessPropertyTest.java | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/associations/any/ManyToAnySubClassAccessPropertyTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/associations/any/ManyToAnySubClassAccessPropertyTest.java index 7a270c331b..39b4e29d9a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/associations/any/ManyToAnySubClassAccessPropertyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/associations/any/ManyToAnySubClassAccessPropertyTest.java @@ -1,12 +1,18 @@ package org.hibernate.orm.test.associations.any; -import static jakarta.persistence.InheritanceType.SINGLE_TABLE; -import static org.hibernate.annotations.CascadeType.ALL; -import static org.junit.jupiter.api.Assertions.assertTrue; - import java.util.HashSet; import java.util.Set; +import org.hibernate.Hibernate; +import org.hibernate.annotations.AnyKeyJavaClass; +import org.hibernate.annotations.Cascade; +import org.hibernate.annotations.ManyToAny; + +import org.hibernate.testing.orm.junit.EntityManagerFactoryScope; +import org.hibernate.testing.orm.junit.JiraKey; +import org.hibernate.testing.orm.junit.Jpa; +import org.junit.jupiter.api.Test; + import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.Column; @@ -22,16 +28,9 @@ import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Table; import jakarta.persistence.Transient; -import org.hibernate.Hibernate; -import org.hibernate.annotations.AnyKeyJavaClass; -import org.hibernate.annotations.Cascade; -import org.hibernate.annotations.ManyToAny; - -import org.hibernate.testing.orm.junit.EntityManagerFactoryScope; -import org.hibernate.testing.orm.junit.JiraKey; -import org.hibernate.testing.orm.junit.Jpa; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; +import static jakarta.persistence.InheritanceType.SINGLE_TABLE; +import static org.hibernate.annotations.CascadeType.ALL; +import static org.junit.jupiter.api.Assertions.assertTrue; @Jpa( annotatedClasses = { @@ -60,7 +59,7 @@ class ManyToAnySubClassAccessPropertyTest { @Entity @Inheritance(strategy = SINGLE_TABLE) - @DiscriminatorColumn(name = "ROLE", length = 100) + @DiscriminatorColumn(name = "ROLE_COL", length = 100) @Table(name = "TANIMAL") public static class Animal { @@ -88,7 +87,7 @@ class ManyToAnySubClassAccessPropertyTest { @ManyToAny @AnyKeyJavaClass(Integer.class) @Cascade(ALL) - @Column(name = "ROLE") + @Column(name = "ROLE_COL") @JoinTable(name = "DOG_OWNER", joinColumns = @JoinColumn(name = "SOURCE"), inverseJoinColumns = @JoinColumn(name = "DEST")) @Override public Set getOwners() { @@ -104,7 +103,7 @@ class ManyToAnySubClassAccessPropertyTest { @ManyToAny @AnyKeyJavaClass(Integer.class) @Cascade(ALL) - @Column(name = "ROLE") + @Column(name = "ROLE_COL") @JoinTable(name = "DOG_OWNER", joinColumns = @JoinColumn(name = "SOURCE"), inverseJoinColumns = @JoinColumn(name = "DEST")) @Override public Set getOwners() {