From 99b93ae949b42d99e397510a6f8c71d56dd39560 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Mon, 13 Aug 2018 23:26:37 -0700 Subject: [PATCH] HHH-12875 HHH-12882 : Drop tables in proper order in test setup methods (cherry picked from commit 770ae50e8b9b84d5e64be3b7f6db78918588cba9) --- .../annotations/LazyManyToManyNonUniqueIdWhereTest.java | 8 ++++---- .../hbm/LazyManyToManyNonUniqueIdNotFoundWhereTest.java | 9 +++++---- .../where/hbm/LazyManyToManyNonUniqueIdWhereTest.java | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/where/annotations/LazyManyToManyNonUniqueIdWhereTest.java b/hibernate-core/src/test/java/org/hibernate/test/where/annotations/LazyManyToManyNonUniqueIdWhereTest.java index c21c0ddaf2..0ac7b6a2b8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/where/annotations/LazyManyToManyNonUniqueIdWhereTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/where/annotations/LazyManyToManyNonUniqueIdWhereTest.java @@ -53,10 +53,10 @@ public class LazyManyToManyNonUniqueIdWhereTest extends BaseCoreFunctionalTestCa doInHibernate( this::sessionFactory, session -> { - session.createSQLQuery( "DROP TABLE MAIN_TABLE" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE ASSOCIATION_TABLE" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE MATERIAL_RATINGS" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE BUILDING_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table MATERIAL_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table BUILDING_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table ASSOCIATION_TABLE" ).executeUpdate(); + session.createSQLQuery( "drop table MAIN_TABLE" ).executeUpdate(); session.createSQLQuery( "create table MAIN_TABLE( " + diff --git a/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdNotFoundWhereTest.java b/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdNotFoundWhereTest.java index 17e81e85fd..886b17df09 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdNotFoundWhereTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdNotFoundWhereTest.java @@ -36,10 +36,11 @@ public class LazyManyToManyNonUniqueIdNotFoundWhereTest extends BaseCoreFunction public void setup() { doInHibernate( this::sessionFactory, session -> { - session.createSQLQuery( "DROP TABLE MAIN_TABLE" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE ASSOCIATION_TABLE" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE MATERIAL_RATINGS" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE BUILDING_RATINGS" ).executeUpdate(); + + session.createSQLQuery( "drop table MATERIAL_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table BUILDING_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table ASSOCIATION_TABLE" ).executeUpdate(); + session.createSQLQuery( "drop table MAIN_TABLE" ).executeUpdate(); session.createSQLQuery( "create table MAIN_TABLE( " + diff --git a/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdWhereTest.java b/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdWhereTest.java index 06c36d0a57..231c14a090 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdWhereTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/where/hbm/LazyManyToManyNonUniqueIdWhereTest.java @@ -42,10 +42,10 @@ public class LazyManyToManyNonUniqueIdWhereTest extends BaseCoreFunctionalTestCa doInHibernate( this::sessionFactory, session -> { - session.createSQLQuery( "DROP TABLE MAIN_TABLE" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE ASSOCIATION_TABLE" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE MATERIAL_RATINGS" ).executeUpdate(); - session.createSQLQuery( "DROP TABLE BUILDING_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table MATERIAL_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table BUILDING_RATINGS" ).executeUpdate(); + session.createSQLQuery( "drop table ASSOCIATION_TABLE" ).executeUpdate(); + session.createSQLQuery( "drop table MAIN_TABLE" ).executeUpdate(); session.createSQLQuery( "create table MAIN_TABLE( " +