mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-12 14:14:49 +00:00
HHH-13554 : QueryAndSQLTest.testNativeQueryWithFormulaAttributeWithoutAlias() fails on Oracle, MSSQL, Sybase, DB2
(cherry picked from commit 2a154cb583374cfea35fce065f103c25e38f2aa3)
This commit is contained in:
parent
cc164e4dec
commit
19fdd0665a
@ -31,7 +31,6 @@
|
||||
import org.hibernate.dialect.function.SQLFunction;
|
||||
import org.hibernate.stat.Statistics;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
@ -95,7 +94,16 @@ public void testNativeQueryWithFormulaAttribute() {
|
||||
|
||||
@Test
|
||||
public void testNativeQueryWithFormulaAttributeWithoutAlias() {
|
||||
String sql = "select TABLE_NAME , sysdate() from all_tables where TABLE_NAME = 'AUDIT_ACTIONS' ";
|
||||
SQLFunction dateFunction = getDialect().getFunctions().get( "current_date" );
|
||||
String dateFunctionRendered = dateFunction.render(
|
||||
null,
|
||||
java.util.Collections.EMPTY_LIST,
|
||||
sessionFactory()
|
||||
);
|
||||
String sql = String.format(
|
||||
"select TABLE_NAME , %s from all_tables where TABLE_NAME = 'AUDIT_ACTIONS' ",
|
||||
dateFunctionRendered
|
||||
);
|
||||
Session s = openSession();
|
||||
s.beginTransaction();
|
||||
s.createSQLQuery( sql ).addEntity( "t", AllTables.class ).list();
|
||||
|
Loading…
x
Reference in New Issue
Block a user