From 5d33adadbcde42d567a4befade8445d4f02df50c Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Wed, 6 Sep 2023 15:10:51 +0200 Subject: [PATCH] HHH-17105 Don't use reserved name role for column --- .../ManyToManySQLJoinTableRestrictionTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/manytomany/ManyToManySQLJoinTableRestrictionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/manytomany/ManyToManySQLJoinTableRestrictionTest.java index cf777521e9..a190d97d27 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/manytomany/ManyToManySQLJoinTableRestrictionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/manytomany/ManyToManySQLJoinTableRestrictionTest.java @@ -147,8 +147,8 @@ public class ManyToManySQLJoinTableRestrictionTest { joinColumns = { @JoinColumn( name = "project_id" ) }, inverseJoinColumns = { @JoinColumn( name = "user_id" ) } ) - @WhereJoinTable( clause = "role = 'manager'" ) - @SQLInsert( sql = "insert into project_users (project_id, user_id, role) values (?, ?, 'manager')" ) + @WhereJoinTable( clause = "role_name = 'manager'" ) + @SQLInsert( sql = "insert into project_users (project_id, user_id, role_name) values (?, ?, 'manager')" ) private Set managers = new HashSet<>(); @ManyToMany @@ -157,8 +157,8 @@ public class ManyToManySQLJoinTableRestrictionTest { joinColumns = { @JoinColumn( name = "project_id" ) }, inverseJoinColumns = { @JoinColumn( name = "user_id" ) } ) - @WhereJoinTable( clause = "role = 'member'" ) - @SQLInsert( sql = "insert into project_users (project_id, user_id, role) values (?, ?, 'member')" ) + @WhereJoinTable( clause = "role_name = 'member'" ) + @SQLInsert( sql = "insert into project_users (project_id, user_id, role_name) values (?, ?, 'member')" ) private Set members = new HashSet<>(); @ManyToMany @@ -207,7 +207,7 @@ public class ManyToManySQLJoinTableRestrictionTest { private String userId; @Id - @Column( name = "role" ) + @Column( name = "role_name" ) private String role; } @@ -218,11 +218,11 @@ public class ManyToManySQLJoinTableRestrictionTest { private String name; @ManyToMany( mappedBy = "managers" ) - @WhereJoinTable( clause = "role = 'manager'" ) + @WhereJoinTable( clause = "role_name = 'manager'" ) private Set managedProjects = new HashSet<>(); @ManyToMany( mappedBy = "members" ) - @WhereJoinTable( clause = "role = 'member'" ) + @WhereJoinTable( clause = "role_name = 'member'" ) private Set otherProjects = new HashSet<>(); public User() {