OPENJPA-906 fix testcase TestEntityTypeExpression

committing patch from Tim McConnell

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@745706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2009-02-19 02:13:02 +00:00
parent 357cf347c8
commit 1a407b6d68
1 changed files with 9 additions and 2 deletions

View File

@ -135,10 +135,16 @@ public class TestEntityTypeExpression extends AbstractTestCase {
type = ((Object[]) rs2.get(0))[1];
assertEquals(type, FemaleUser.class);
query = "SELECT e FROM CompUser e where TYPE(e) = :typeName";
query = "SELECT e FROM CompUser e where TYPE(e) = :typeName " +
" ORDER BY e.name";
rs = em.createQuery(query).
setParameter("typeName", FemaleUser.class).getResultList();
assertTrue(rs.size()==3);
user = rs.get(0);
assertEquals("Famzy", user.getName());
user = rs.get(1);
assertEquals("Shade", user.getName());
user = rs.get(2);
assertEquals("Shannon", user.getName());
query = "SELECT e FROM CompUser e where TYPE(e) = ?1 ORDER BY e.name";
@ -147,7 +153,8 @@ public class TestEntityTypeExpression extends AbstractTestCase {
user = rs.get(0);
assertEquals("Famzy", user.getName());
query = "SELECT e FROM CompUser e where TYPE(e) in (?1) ORDER BY e.name DESC";
query = "SELECT e FROM CompUser e where TYPE(e) in (?1)" +
" ORDER BY e.name DESC";
rs = em.createQuery(query).
setParameter(1, MaleUser.class).getResultList();
user = rs.get(0);