You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by br...@apache.org on 2003/03/01 21:53:39 UTC
cvs commit: db-ojb/src/test/org/apache/ojb/broker QueryTest.java
brj 2003/03/01 12:53:39
Modified: src/test/org/apache/ojb/broker QueryTest.java
Log:
new testcase for user defined alias
Revision Changes Path
1.22 +28 -0 db-ojb/src/test/org/apache/ojb/broker/QueryTest.java
Index: QueryTest.java
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/QueryTest.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- QueryTest.java 19 Feb 2003 18:20:08 -0000 1.21
+++ QueryTest.java 1 Mar 2003 20:53:39 -0000 1.22
@@ -747,6 +747,34 @@
}
/**
+ * Test pathExpression and Extents using Alias
+ */
+ public void testPathExpressionForExtentsAlias()
+ {
+ ArrayList list = new java.util.ArrayList();
+
+ Criteria crit1 = new Criteria();
+ crit1.setAlias("NAMES");
+ crit1.addLike("upper(allArticlesInGroup.articleName)", "F%");
+
+ Criteria crit2 = new Criteria();
+ crit2.addGreaterOrEqualThan("allArticlesInGroup.stock", new Integer(110));
+
+ crit1.addAndCriteria(crit2);
+ Query q = QueryFactory.newQuery(ProductGroup.class, crit1, true);
+
+ Iterator iter = broker.getIteratorByQuery(q);
+ while (iter.hasNext())
+ {
+ list.add(iter.next());
+ }
+
+ // ProductGroup 4
+ assertEquals("check size", list.size(), 1);
+ }
+
+
+ /**
* Run a query range test that includes one record less than the
* total number of records that exist.
*/