From 38d4fe6b31d10afb5d489ba944a8854955cf87d7 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sun, 5 Jan 2025 21:19:56 +0200 Subject: [PATCH] HHH-19011 fix incorrect placement of table comment with @Comment This annotation is deprecated in 7, but I guess this is a candidate for backport --- .../main/java/org/hibernate/binder/internal/CommentBinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/binder/internal/CommentBinder.java b/hibernate-core/src/main/java/org/hibernate/binder/internal/CommentBinder.java index bafe20609a14..af1fbb59b9b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/binder/internal/CommentBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/binder/internal/CommentBinder.java @@ -38,7 +38,7 @@ public void bind(Comment comment, MetadataBuildingContext context, PersistentCla } else if ( value instanceof Collection ) { Collection collection = (Collection) value; - Table table = collection.getTable(); + Table table = collection.getCollectionTable(); // by default, the comment goes on the table if ( on.isEmpty() || table.getName().equalsIgnoreCase( on ) ) { table.setComment( text );