Skip to content

Commit

Permalink
HHH-7525 Reintroduce FailureExpected test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Murphy authored and beikov committed Jun 23, 2022
1 parent 665004f commit 828a192
Showing 1 changed file with 15 additions and 1 deletion.
Expand Up @@ -11,6 +11,7 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.query.NativeQuery;

import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.After;
Expand Down Expand Up @@ -70,7 +71,20 @@ public void cleanup() {
}

@Test
public void testNativeQuery() throws Exception {
@FailureExpected( jiraKey = "HHH-7525" )
public void testNativeQueryWithoutFormulaField() throws Exception {
doInHibernate(
this::sessionFactory, session -> {
// the native query result mapping fails if the formula field is not returned from the query
Query query = session.createNativeQuery( "SELECT ft.* FROM foo_table ft", Foo.class );
List<Foo> list = query.getResultList();
assertEquals( 3, list.size() );
}
);
}

@Test
public void testNativeQueryWithAllFields() throws Exception {
doInHibernate(
this::sessionFactory, session -> {
Query query = session.createNativeQuery( "SELECT ft.*, abs(locationEnd - locationStart) as distance FROM foo_table ft", Foo.class );
Expand Down

0 comments on commit 828a192

Please sign in to comment.