From 99660eb2608a031569438dd14520ca9cc4665404 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 18 Jul 2024 09:29:36 +0300 Subject: [PATCH] HBX-2868: Replace use of deprecated constructor 'org.hibernate.mapping.Table#Table() Signed-off-by: Koen Aers --- .../tool/internal/reveng/RevengMetadataCollector.java | 2 +- .../tool/internal/reveng/strategy/OverrideBinder.java | 6 +++--- .../org/hibernate/tools/test/util/HibernateUtilTest.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/orm/src/main/java/org/hibernate/tool/internal/reveng/RevengMetadataCollector.java b/orm/src/main/java/org/hibernate/tool/internal/reveng/RevengMetadataCollector.java index b48388bcea..c8e9d5ebc8 100644 --- a/orm/src/main/java/org/hibernate/tool/internal/reveng/RevengMetadataCollector.java +++ b/orm/src/main/java/org/hibernate/tool/internal/reveng/RevengMetadataCollector.java @@ -80,7 +80,7 @@ public void addSuggestedIdentifierStrategy(String catalog, String schema, String } private Table createTable(String catalog, String schema, String name) { - Table table = new Table(); + Table table = new Table("Hibernate Tools"); table.setAbstract(false); table.setName(name); table.setSchema(schema); diff --git a/orm/src/main/java/org/hibernate/tool/internal/reveng/strategy/OverrideBinder.java b/orm/src/main/java/org/hibernate/tool/internal/reveng/strategy/OverrideBinder.java index 5c122e360f..42d2821f56 100644 --- a/orm/src/main/java/org/hibernate/tool/internal/reveng/strategy/OverrideBinder.java +++ b/orm/src/main/java/org/hibernate/tool/internal/reveng/strategy/OverrideBinder.java @@ -75,7 +75,7 @@ private static void bindTables( ArrayList tables, OverrideRepository repository) { for (Element element : tables) { - Table table = new Table(); + Table table = new Table("Hibernate Tools"); table.setCatalog(getAttribute(element, "catalog")); table.setSchema(getAttribute(element, "schema")); table.setName(getAttribute(element, "name")); @@ -154,7 +154,7 @@ private static List bindColumns( List localColumns = new ArrayList(); localColumns.add(column); List foreignColumns = new ArrayList(); - Table foreignTable = new Table(); + Table foreignTable = new Table("Hibernate Tools"); foreignTable.setName(foreignTableName); foreignTable.setCatalog( element.hasAttribute("foreign-catalog") ? @@ -192,7 +192,7 @@ private static void bindForeignKeys( String constraintName = getAttribute(element, "constraint-name"); String foreignTableName = getAttribute(element, "foreign-table"); if (foreignTableName != null) { - Table foreignTable = new Table(); + Table foreignTable = new Table("hibernate tools"); foreignTable.setName(foreignTableName); foreignTable.setCatalog( element.hasAttribute("foreign-catalog") ? diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java index 96a277d0b8..139da96a8b 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java @@ -45,7 +45,7 @@ public class HibernateUtilTest { @Test public void testGetForeignKey() { - Table table = new Table(); + Table table = new Table("Hibernate Tools"); assertNull(HibernateUtil.getForeignKey(table, "foo")); assertNull(HibernateUtil.getForeignKey(table, "bar")); table.createForeignKey("foo", Collections.emptyList(), "Bar", null);