HHH-11419 - QueryAndSQLTest failing on MS SQL Server

(cherry picked from commit 95b858bf20)
This commit is contained in:
Jan Martiska 2017-01-24 15:49:58 +00:00 committed by Gail Badner
parent 4f6b95afd8
commit 5f68b9a906
1 changed files with 7 additions and 7 deletions

View File

@ -78,11 +78,11 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
);
String sql = String.format(
"select t.table_name as {t.tableName}, %s as {t.daysOld} from ALL_TABLES t where t.table_name = 'AUDIT_ACTIONS' ",
"select t.TABLE_NAME as {t.tableName}, %s as {t.daysOld} from ALL_TABLES t where t.TABLE_NAME = 'AUDIT_ACTIONS' ",
dateFunctionRendered
);
String sql2 = String.format(
"select table_name as t_name, %s as t_time from ALL_TABLES where table_name = 'AUDIT_ACTIONS' ",
"select TABLE_NAME as t_name, %s as t_time from ALL_TABLES where TABLE_NAME = 'AUDIT_ACTIONS' ",
dateFunctionRendered
);
@ -101,7 +101,7 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test
@FailureExpected(jiraKey = "HHH-2225")
public void testNativeQueryWithFormulaAttributeWithoutAlias() {
String sql = "select table_name , sysdate() from all_tables where table_name = 'AUDIT_ACTIONS' ";
String sql = "select TABLE_NAME , sysdate() from all_tables where TABLE_NAME = 'AUDIT_ACTIONS' ";
Session s = openSession();
s.beginTransaction();
s.createSQLQuery( sql ).addEntity( "t", AllTables.class ).list();
@ -231,12 +231,12 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
s.flush();
s.clear();
List chaoses = s.createSQLQuery( "select * from Chaos where chaos_size is null or chaos_size = :chaos_size" )
List chaoses = s.createSQLQuery( "select * from CHAOS where chaos_size is null or chaos_size = :chaos_size" )
.setParameter( "chaos_size", null )
.list();
assertEquals( 1, chaoses.size() );
chaoses = s.createSQLQuery( "select * from Chaos where chaos_size = :chaos_size" )
chaoses = s.createSQLQuery( "select * from CHAOS where chaos_size = :chaos_size" )
.setParameter( "chaos_size", null )
.list();
// should be no results because null != null
@ -272,12 +272,12 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
s.flush();
s.clear();
List chaoses = s.createSQLQuery( "select * from Chaos where chaos_size is null or chaos_size = :chaos_size" )
List chaoses = s.createSQLQuery( "select * from CHAOS where chaos_size is null or chaos_size = :chaos_size" )
.setParameter( "chaos_size", null, StandardBasicTypes.LONG )
.list();
assertEquals( 1, chaoses.size() );
chaoses = s.createSQLQuery( "select * from Chaos where chaos_size = :chaos_size" )
chaoses = s.createSQLQuery( "select * from CHAOS where chaos_size = :chaos_size" )
.setParameter( "chaos_size", null, StandardBasicTypes.LONG )
.list();
// should be no results because null != null