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 TableAliasHandler.java
Date Sun, 10 Oct 2004 15:15:22 GMT
brj         2004/10/10 08:15:22

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        SqlQueryStatement.java TableAliasHandler.java
  Log:
  minor refactorings
  
  Revision  Changes    Path
  1.87      +12 -4     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.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- SqlQueryStatement.java	10 Oct 2004 09:24:57 -0000	1.86
  +++ SqlQueryStatement.java	10 Oct 2004 15:15:22 -0000	1.87
  @@ -98,19 +98,27 @@
   
           if (parent != null)
           {
  -            m_tableAliasHandler = new TableAliasHandler(parent.m_tableAliasHandler, m_query,
cld);
  +            m_tableAliasHandler = new TableAliasHandler(parent.m_tableAliasHandler, m_query,
cld, m_logger);
           }
           else
           {
  -            m_tableAliasHandler = new TableAliasHandler(null, m_query, cld);          
 
  +            m_tableAliasHandler = new TableAliasHandler(null, m_query, cld, m_logger);
           
           }
       }
   
  +    /**
  +     * return the descriptor of the base class, with respect to which all paths are done
  +     * @return
  +     */
       protected ClassDescriptor getBaseClassDescriptor()
       {
           return m_tableAliasHandler.getBaseClassDescriptor();
       }
   
  +    /**
  +     * return the descriptor of the search class, representing the extent to be searched
  +     * @return
  +     */
       protected ClassDescriptor getSearchClassDescriptor()
       {
           return m_tableAliasHandler.getSearchClassDescriptor();
  @@ -1290,7 +1298,7 @@
        * Returns the joinSyntaxType.
        * @return byte
        */
  -    protected byte getJoinSyntaxType()
  +    private byte getJoinSyntaxType()
       {
           return m_platform.getJoinSyntaxType();
       }
  
  
  
  1.2       +8 -5      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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TableAliasHandler.java	10 Oct 2004 09:24:57 -0000	1.1
  +++ TableAliasHandler.java	10 Oct 2004 15:15:22 -0000	1.2
  @@ -65,16 +65,19 @@
       private Map m_joinTreeToCriteria = new HashMap();
       /** the logger */
       private Logger m_logger;
  +    /** the parent handler or null*/
       private TableAliasHandler m_parentHandler;
  +    /** the descriptor of the base class, with respect to which all paths are done */
       private ClassDescriptor m_baseCld;
  +    /** the descriptor of the search class, representing the extent to be searched */
       private ClassDescriptor m_searchCld;
   
       private int m_aliasCount = 0;
   
       
  -    TableAliasHandler(TableAliasHandler parent, QueryByCriteria aQuery, ClassDescriptor
searchCld)
  +    TableAliasHandler(TableAliasHandler parent, QueryByCriteria aQuery, ClassDescriptor
searchCld, Logger logger)
       {      
  -        m_logger = LoggerFactory.getLogger(TableAliasHandler.class);
  +        m_logger = logger != null ? logger : LoggerFactory.getLogger(TableAliasHandler.class);
           m_query = aQuery;       
           m_parentHandler = parent;
           m_searchCld = searchCld;
  @@ -750,7 +753,7 @@
           final String alias;
           List extents = new ArrayList();
           List hints = new ArrayList();
  -        List joins;
  +        List joins = new ArrayList();
   
           TableAlias(String aTable, String anAlias)
           {
  @@ -899,7 +902,7 @@
   
           boolean hasJoins()
           {
  -            return (joins != null);
  +            return (!joins.isEmpty());
           }
   
           public String toString()
  
  
  

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