HHH-11419 - QueryAndSQLTest failing on MS SQL Server
(cherry picked from commit 95b858bf20
)
This commit is contained in:
parent
4f6b95afd8
commit
5f68b9a906
|
@ -78,11 +78,11 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
|
||||||
);
|
);
|
||||||
|
|
||||||
String sql = String.format(
|
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
|
dateFunctionRendered
|
||||||
);
|
);
|
||||||
String sql2 = String.format(
|
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
|
dateFunctionRendered
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
|
||||||
@Test
|
@Test
|
||||||
@FailureExpected(jiraKey = "HHH-2225")
|
@FailureExpected(jiraKey = "HHH-2225")
|
||||||
public void testNativeQueryWithFormulaAttributeWithoutAlias() {
|
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();
|
Session s = openSession();
|
||||||
s.beginTransaction();
|
s.beginTransaction();
|
||||||
s.createSQLQuery( sql ).addEntity( "t", AllTables.class ).list();
|
s.createSQLQuery( sql ).addEntity( "t", AllTables.class ).list();
|
||||||
|
@ -231,12 +231,12 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
|
||||||
s.flush();
|
s.flush();
|
||||||
s.clear();
|
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 )
|
.setParameter( "chaos_size", null )
|
||||||
.list();
|
.list();
|
||||||
assertEquals( 1, chaoses.size() );
|
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 )
|
.setParameter( "chaos_size", null )
|
||||||
.list();
|
.list();
|
||||||
// should be no results because null != null
|
// should be no results because null != null
|
||||||
|
@ -272,12 +272,12 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
|
||||||
s.flush();
|
s.flush();
|
||||||
s.clear();
|
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 )
|
.setParameter( "chaos_size", null, StandardBasicTypes.LONG )
|
||||||
.list();
|
.list();
|
||||||
assertEquals( 1, chaoses.size() );
|
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 )
|
.setParameter( "chaos_size", null, StandardBasicTypes.LONG )
|
||||||
.list();
|
.list();
|
||||||
// should be no results because null != null
|
// should be no results because null != null
|
||||||
|
|
Loading…
Reference in New Issue