Author: steve.ebersole(a)jboss.com
Date: 2006-11-21 11:33:52 -0500 (Tue, 21 Nov 2006)
New Revision: 10850
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
more component type queries
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
---
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2006-11-21
16:33:38 UTC (rev 10849)
+++
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2006-11-21
16:33:52 UTC (rev 10850)
@@ -45,6 +45,7 @@
import org.hibernate.transform.Transformers;
import org.hibernate.type.ManyToOneType;
import org.hibernate.type.Type;
+import org.hibernate.type.ComponentType;
import org.hibernate.util.StringHelper;
/**
@@ -173,6 +174,10 @@
Session s = openSession();
s.beginTransaction();
+ Type[] types = s.createQuery( "select h.name from Human h"
).getReturnTypes();
+ assertEquals( 1, types.length );
+ assertTrue( types[0] instanceof ComponentType );
+
// Test the ability to perform comparisions between component values
s.createQuery( "from Human h where h.name = h.name" ).list();
s.createQuery( "from Human h where h.name = :name" ).setParameter(
"name", new Name() ).list();
@@ -186,6 +191,8 @@
s.createQuery( "from Human h where ('John', 'X', 'Doe')
<> h.name" ).list();
s.createQuery( "from Human h where ('John', 'X', 'Doe')
>= h.name" ).list();
+ s.createQuery( "from Human h order by h.name" ).list();
+
s.getTransaction().commit();
s.close();
}