brj         2005/12/01 13:32:21

  Modified:    src/java/org/apache/ojb/broker/query
                        QueryByCriteriaImpl.java
               src/java/org/apache/ojb/broker/accesslayer/sql
                        TableAliasHandler.java
  Log:
  -use path instead of attribute to determine if it's an outer join
  -minor refactoring of pathOuterJoin
  
  Revision  Changes    Path
  1.2       +7 -25     
db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteriaImpl.java
  
  Index: QueryByCriteriaImpl.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteriaImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- QueryByCriteriaImpl.java  1 Apr 2005 20:28:08 -0000       1.1
  +++ QueryByCriteriaImpl.java  1 Dec 2005 21:32:21 -0000       1.2
  @@ -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 = new ArrayList();
   
  -    private Map m_pathOuterJoin = new HashMap();
  +    private Collection m_pathOuterJoins = new HashSet();
   
       /**
        * handy criteria that can be used to select all instances of
  @@ -161,7 +162,7 @@
           m_orderby = aQuery.getOrderBy();
           m_objectProjectionAttribute = aQuery.getObjectProjectionAttribute();
           m_pathClasses = aQuery.getPathClasses();
  -        m_pathOuterJoin = aQuery.getPathOuterJoinMap();
  +        m_pathOuterJoins = aQuery.getOuterJoinPaths();
           m_prefetchedRelationships = aQuery.getPrefetchedRelationships();
       }
   
  @@ -206,16 +207,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);
       }
   
       /**
  @@ -223,7 +215,7 @@
        */
       public void setPathOuterJoin(String aPath)
       {
  -        getPathOuterJoinMap().put(aPath, Boolean.TRUE);
  +        getOuterJoinPaths().add(aPath);
       }
   
       /* (non-Javadoc)
  @@ -491,21 +483,11 @@
       }
   
        /**
  -     * 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;
  -    }
  -
  -     /**
        * @see org.apache.ojb.broker.query.QueryByCriteria#getOuterJoinPaths()
        */
       public Collection getOuterJoinPaths()
       {
  -        return getPathOuterJoinMap().keySet();
  +        return m_pathOuterJoins;
       }
       
       /**
  
  
  
  1.16      +2 -2      
db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/TableAliasHandler.java
  
  Index: TableAliasHandler.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/TableAliasHandler.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TableAliasHandler.java    14 Nov 2005 17:45:54 -0000      1.15
  +++ TableAliasHandler.java    1 Dec 2005 21:32:21 -0000       1.16
  @@ -422,7 +422,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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to