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 Wed, 02 Nov 2005 21:18:00 GMT
brj         2005/11/02 13:18:00

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        SqlQueryStatement.java
  Log:
  fix for ojb-72: indirection table should be added only once
  
  Revision  Changes    Path
  1.103     +8 -3      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.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- SqlQueryStatement.java	28 Oct 2005 20:30:06 -0000	1.102
  +++ SqlQueryStatement.java	2 Nov 2005 21:17:57 -0000	1.103
  @@ -1163,16 +1163,21 @@
               stmtFromPos = buf.length(); // store position of join (by: Terry Dexter)
           }
   
  -        if (!(joinSyntax == SQL92_NOPAREN_JOIN_SYNTAX && alias != getRootAlias()))
  +        if (alias == getRootAlias())
           {
               appendTableAlias(alias, buf);
   
  +            // BRJ: also add indirection table to FROM-clause for MtoNQuery 
               if (getQuery() instanceof MtoNQuery)
               {
                   MtoNQuery mnQuery = (MtoNQuery)m_query; 
                   buf.append(", ");
                   appendTableAlias(getTableAliasForPath(mnQuery.getIndirectionTable()), buf);
  -            }
  +            }           
  +        }
  +        else if (joinSyntax != SQL92_NOPAREN_JOIN_SYNTAX)
  +        {
  +            appendTableAlias(alias, buf);
           }
   
           if (!alias.hasJoins())
  
  
  

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