db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker QueryTest.java
Date Thu, 01 Dec 2005 21:26:19 GMT
brj         2005/12/01 13:26:19

  Modified:    src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        QueryTest.java
  Log:
  added testOuterJoin()
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.61.2.19 +30 -2     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.61.2.18
  retrieving revision 1.61.2.19
  diff -u -r1.61.2.18 -r1.61.2.19
  --- QueryTest.java	13 Nov 2005 16:14:04 -0000	1.61.2.18
  +++ QueryTest.java	1 Dec 2005 21:26:19 -0000	1.61.2.19
  @@ -1696,7 +1696,7 @@
   
           Criteria crit = new Criteria();
           crit.addLike("groupName", "%o%");
  -        crit.addLike("allArticlesInGroup.articleName", "%\u00f6%"); //unicode for 
  +        crit.addLike("allArticlesInGroup.articleName", "%\u00f6%"); //unicode for �
   
           ReportQueryByCriteria q = QueryFactory.newReportQuery(ProductGroup.class, crit,
true);
           q.setAttributes(new String[]{"groupId", "groupName"});
  @@ -2126,6 +2126,34 @@
           assertEquals(count, result.size());
       }
   
  +    public void testOuterJoin()
  +    {
  +        Article a = new Article();
  +        a.articleName = "Good stuff";
  +        a.productGroup = null;
  +        broker.beginTransaction();
  +        broker.store(a);
  +        broker.commitTransaction();
  +        
  +        Criteria crit = new Criteria();
  +        crit.addLike("articleName", "G%");
  +        crit.addIsNull("productGroup.description");
  +        
  +        QueryByCriteria qry1 = QueryFactory.newQuery(Article.class, crit);
  +        Collection result1 = broker.getCollectionByQuery(qry1);
  +
  +        QueryByCriteria qry2 = QueryFactory.newQuery(Article.class, crit);
  +        qry2.setPathOuterJoin("productGroup");
  +        Collection result2 = broker.getCollectionByQuery(qry2);
  +        
  +        assertEquals(0, result1.size());
  +        assertEquals(1, result2.size());
  +        
  +        broker.beginTransaction();
  +        broker.delete(a);
  +        broker.commitTransaction();
  +    }
  +    
       public void testExtentByInterface()
       {
           String name = "testExtentByInterface_" + System.currentTimeMillis();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message