OPENJPA-1560 Committing JDBC escape sequence tests contributed by Dianne Richards.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@921550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jeremy Bauer 2010-03-10 20:22:57 +00:00
parent f69da24268
commit 6234dbddfc
1 changed files with 12 additions and 0 deletions

View File

@ -73,7 +73,19 @@ public class TestJDBCEscapeDate extends SingleEMFTestCase {
List results = q.getResultList();
Assert.assertEquals(1, results.size());
}
// Test support in HAVING clause.
String[] havingJpql = {
"select a from Employee a group by a.hireTime having a.hireTime >= {t '00:00:00'}",
"select a from Employee a group by a.hireDate having a.hireDate >= {d '2009-08-25'}",
"select a from Employee a group by a.hireTimestamp having a.hireTimestamp >= {d '2009-08-25'}"
};
for (int j = 0; j < havingJpql.length; j++) {
Query q = em.createQuery(havingJpql[j]);
List results = q.getResultList();
Assert.assertEquals(1, results.size());
}
em.getTransaction().begin();
String update = "update Employee a set a.hireTimestamp = {ts '2009-08-25 00:00:00.123456'} where a.empId = 1";
Query q = em.createQuery(update);