@@ -92,6 +92,18 @@ protected void setProperties(Configuration configuration) {
92
92
setDefaultProperties ( configuration );
93
93
}
94
94
95
+ /**
96
+ * Set the properties related to the SQL logs.
97
+ * Some tests won't extend this class, but we still want to apply the same rules for these kinds of properties.
98
+ */
99
+ public static void setSqlLoggingProperties (Configuration configuration ) {
100
+ // Use JAVA_TOOL_OPTIONS='-Dhibernate.show_sql=true'
101
+ // Keep the default to false, otherwise the log on CI becomes too big
102
+ configuration .setProperty ( Settings .SHOW_SQL , System .getProperty ( Settings .SHOW_SQL , "false" ) );
103
+ configuration .setProperty ( Settings .FORMAT_SQL , System .getProperty ( Settings .FORMAT_SQL , "false" ) );
104
+ configuration .setProperty ( Settings .HIGHLIGHT_SQL , System .getProperty ( Settings .HIGHLIGHT_SQL , "true" ) );
105
+ }
106
+
95
107
/**
96
108
* Configure default properties common to most tests.
97
109
*/
@@ -102,13 +114,9 @@ public static void setDefaultProperties(Configuration configuration) {
102
114
configuration .setProperty ( Settings .HBM2DDL_IMPORT_FILES , "/db2.sql" );
103
115
doneTablespace = true ;
104
116
}
105
- // Use JAVA_TOOL_OPTIONS='-Dhibernate.show_sql=true'
106
- // Keep the default to false, otherwise the log on CI becomes too big
107
- configuration .setProperty ( Settings .SHOW_SQL , System .getProperty ( Settings .SHOW_SQL , "false" ) );
108
- configuration .setProperty ( Settings .FORMAT_SQL , System .getProperty ( Settings .FORMAT_SQL , "false" ) );
109
- configuration .setProperty ( Settings .HIGHLIGHT_SQL , System .getProperty ( Settings .HIGHLIGHT_SQL , "true" ) );
110
117
configuration .setProperty ( PersistentTableStrategy .DROP_ID_TABLES , "true" );
111
118
configuration .setProperty ( GlobalTemporaryTableStrategy .DROP_ID_TABLES , "true" );
119
+ setSqlLoggingProperties ( configuration );
112
120
}
113
121
114
122
public static final SessionFactoryManager factoryManager = new SessionFactoryManager ();
0 commit comments