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 Mon, 28 Nov 2005 22:42:22 GMT
brj         2005/11/28 14:42:22

  Modified:    src/test/org/apache/ojb/broker QueryTest.java
  Log:
  added testOuterJoin()
  
  Revision  Changes    Path
  1.89      +29 -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.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- QueryTest.java	13 Nov 2005 16:22:49 -0000	1.88
  +++ QueryTest.java	28 Nov 2005 22:42:22 -0000	1.89
  @@ -2449,6 +2449,35 @@
           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 = ojb.getQueryFactory().newQuery(Article.class, crit);
  +        Collection result1 = broker.getCollectionByQuery(qry1);
  +
  +        QueryByCriteria qry2 = ojb.getQueryFactory().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