mirror of https://github.com/apache/openjpa.git
OPENJPA-703 fix TestOptimizeForClause testcase
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@741745 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
72fa143e53
commit
ed3889ff69
|
@ -44,19 +44,21 @@ public class TestOptimizeForClause
|
|||
DBDictionary dict = ((JDBCConfiguration) em.getConfiguration())
|
||||
.getDBDictionaryInstance();
|
||||
|
||||
em.getTransaction().begin();
|
||||
AllFieldTypes a = new AllFieldTypes();
|
||||
a.setIntField(123);
|
||||
em.persist(a);
|
||||
em.getTransaction().commit();
|
||||
em.clear();
|
||||
|
||||
sql.clear();
|
||||
Object result = em.createQuery
|
||||
("select o from AllFieldTypes o where o.intField = 123").
|
||||
getSingleResult();
|
||||
|
||||
try {
|
||||
Object result = em.createQuery
|
||||
("select o from AllFieldTypes o where o.intField = 0").
|
||||
getSingleResult();
|
||||
|
||||
assertNull(result);
|
||||
if (dict instanceof DB2Dictionary ) {
|
||||
assertContainsSQL(" optimize for 1 row");
|
||||
}
|
||||
} catch (NoResultException pe) {
|
||||
;
|
||||
assertNotNull(result);
|
||||
if (dict instanceof DB2Dictionary ) {
|
||||
assertContainsSQL(" optimize for 1 row");
|
||||
}
|
||||
em.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue