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/java/org/apache/ojb/broker/query Criteria.java
Date Sun, 06 Apr 2003 20:26:07 GMT
brj         2003/04/06 13:26:07

  Modified:    src/java/org/apache/ojb/broker/query Criteria.java
  Log:
  fixed problem with parent pointer in addAnd/OrCriteria
  
  Revision  Changes    Path
  1.29      +21 -5     db-ojb/src/java/org/apache/ojb/broker/query/Criteria.java
  
  Index: Criteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/Criteria.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Criteria.java	6 Apr 2003 20:13:16 -0000	1.28
  +++ Criteria.java	6 Apr 2003 20:26:07 -0000	1.29
  @@ -162,6 +162,24 @@
           crit.setParentCriteria(this);
           m_criteria.addElement(crit);
       }
  +
  +    protected void addCriteria(Vector criteria)
  +    {
  +        Object crit;
  +        
  +        for (int i = 0; i < criteria.size(); i++)
  +        {
  +            crit = criteria.elementAt(i);
  +            if (crit instanceof SelectionCriteria)
  +            {
  +                addSelectionCriteria((SelectionCriteria)crit);
  +            }
  +            else if (crit instanceof Criteria)
  +            {
  +                addCriteria((Criteria)crit);
  +            }
  +        }
  +    }
       
   	/**
   	 * Answer a List of InCriteria based on values, each InCriteria
  @@ -674,8 +692,7 @@
   		{
   			setEmbraced(false);
   			setType(NONE); // root object
  -			m_criteria = pc.getCriteria();
  -            pc.setParentCriteria(this);        
  +            addCriteria(pc.getCriteria());
   
   			orderby.addAll(pc._getOrderby());
   			groupby.addAll(pc._getGroupby());
  @@ -831,8 +848,7 @@
   		{
   			setEmbraced(false);
   			setType(NONE); // root object
  -			m_criteria = pc.getCriteria();  
  -            pc.setParentCriteria(this);        
  +            addCriteria(pc.getCriteria());
   
   			orderby.addAll(pc._getOrderby());
   			groupby.addAll(pc._getGroupby());
  
  
  

Mime
View raw message