HHH-2951 test case
This commit is contained in:
parent
70454c9168
commit
5c5998aea9
|
@ -2046,6 +2046,32 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
|
||||||
t.rollback();
|
t.rollback();
|
||||||
s.close();
|
s.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestForIssue( jiraKey = "HHH-2951" )
|
||||||
|
public void testNullCriteria() {
|
||||||
|
Course course = new Course();
|
||||||
|
course.setCourseCode( "1234" );
|
||||||
|
course.setDescription( null );
|
||||||
|
|
||||||
|
Session s = openSession();
|
||||||
|
Transaction t = s.beginTransaction();
|
||||||
|
|
||||||
|
s.persist( course );
|
||||||
|
s.flush();
|
||||||
|
s.clear();
|
||||||
|
|
||||||
|
// Ensure Restrictions creates "where foo is null", instead of
|
||||||
|
// "where foo = null"
|
||||||
|
List<Course> courses = s.createCriteria( Course.class ).add(
|
||||||
|
Restrictions.eq( "description", null) ).list();
|
||||||
|
|
||||||
|
assertEquals( courses.size(), 1 );
|
||||||
|
assertEquals( courses.get( 0 ).getCourseCode(), course.getCourseCode() );
|
||||||
|
|
||||||
|
t.rollback();
|
||||||
|
s.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue