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/accesslayer/sql SqlQueryStatement.java
Date Thu, 01 Dec 2005 21:30:29 GMT
brj         2005/12/01 13:30:29

  Modified:    src/java/org/apache/ojb/broker/query Tag: OJB_1_0_RELEASE
                        QueryByCriteria.java
               src/java/org/apache/ojb/broker/accesslayer/sql Tag:
                        OJB_1_0_RELEASE SqlQueryStatement.java
  Log:
  -use path instead of attribute to determine if it's an outer join
  -minor refactoring of pathOuterJoin
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.26.2.1  +7 -25     db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java
  
  Index: QueryByCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java,v
  retrieving revision 1.26
  retrieving revision 1.26.2.1
  diff -u -r1.26 -r1.26.2.1
  --- QueryByCriteria.java	9 Jun 2004 20:00:44 -0000	1.26
  +++ QueryByCriteria.java	1 Dec 2005 21:30:29 -0000	1.26.2.1
  @@ -18,6 +18,7 @@
   import java.util.ArrayList;
   import java.util.Collection;
   import java.util.HashMap;
  +import java.util.HashSet;
   import java.util.List;
   import java.util.Map;
   
  @@ -62,7 +63,7 @@
       // list of names of prefetchable relationships
       private List m_prefetchedRelationships = null;
   
  -    private Map m_pathOuterJoin;
  +    private Collection m_pathOuterJoins = null;
   
       /**
        * handy criteria that can be used to select all instances of
  @@ -86,7 +87,7 @@
           m_groupby = new ArrayList();
           m_orderby = new ArrayList();
           m_prefetchedRelationships = new ArrayList();
  -        m_pathOuterJoin = new HashMap();
  +        m_pathOuterJoins = new HashSet();
       }
   
       /**
  @@ -241,16 +242,7 @@
        */
       public boolean isPathOuterJoin(String aPath)
       {
  -        Boolean result = (Boolean)getPathOuterJoinMap().get(aPath);
  -
  -        if (result != null)
  -        {
  -            return result.booleanValue();
  -        }
  -        else
  -        {
  -            return false;
  -        }
  +        return getOuterJoinPaths().contains(aPath);
       }
   
       /**
  @@ -260,7 +252,7 @@
        */
       public void setPathOuterJoin(String aPath)
       {
  -        getPathOuterJoinMap().put(aPath, Boolean.TRUE);
  +        getOuterJoinPaths().add(aPath);
       }
   
       /* (non-Javadoc)
  @@ -505,22 +497,12 @@
       }
   
   	/**
  -     * Get a Map containing hints about the Outer-Join-Setting
  -     * of a Path, key is the Path value a Boolean
  -	 * @return a Map containing Outer-Join-Settings for the Paths.
  -	 */
  -    protected Map getPathOuterJoinMap()
  -    {
  -        return m_pathOuterJoin;
  -    }
  -
  -	/**
        * Get a Collection containing all Paths having an Outer-Joins-Setting
   	 * @return a Collection containing the Paths
   	 */
       public Collection getOuterJoinPaths()
       {
  -        return getPathOuterJoinMap().keySet();
  +        return m_pathOuterJoins;
       }
       
       public String getObjectProjectionAttribute()
  
  
  
  No                   revision
  No                   revision
  1.75.2.18 +2 -2      db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
  
  Index: SqlQueryStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java,v
  retrieving revision 1.75.2.17
  retrieving revision 1.75.2.18
  diff -u -r1.75.2.17 -r1.75.2.18
  --- SqlQueryStatement.java	19 Nov 2005 08:46:33 -0000	1.75.2.17
  +++ SqlQueryStatement.java	1 Dec 2005 21:30:29 -0000	1.75.2.18
  @@ -1072,7 +1072,7 @@
   			}
   
   			// look for outer join hint
  -			outer = outer || getQuery().isPathOuterJoin(attr);
  +			outer = outer || getQuery().isPathOuterJoin(attrPath);
   
   			// look for 1:n or m:n
   			if (ord instanceof CollectionDescriptor)
  
  
  

---------------------------------------------------------------------
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