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 Fri, 28 Oct 2005 19:48:07 GMT
brj         2005/10/28 12:48:07

  Modified:    src/java/org/apache/ojb/broker/core Tag: OJB_1_0_RELEASE
                        QueryReferenceBroker.java
               src/java/org/apache/ojb/broker/accesslayer/sql Tag:
                        OJB_1_0_RELEASE SqlQueryStatement.java
  Log:
  fix for ojb-72
  an alias is now used for the indirection table
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.17.2.14 +3 -3      db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java
  
  Index: QueryReferenceBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java,v
  retrieving revision 1.17.2.13
  retrieving revision 1.17.2.14
  diff -u -r1.17.2.13 -r1.17.2.14
  --- QueryReferenceBroker.java	5 Oct 2005 18:01:29 -0000	1.17.2.13
  +++ QueryReferenceBroker.java	28 Oct 2005 19:48:06 -0000	1.17.2.14
  @@ -860,11 +860,11 @@
   
           for (int i = 0; i < thisClassFks.length; i++)
           {
  -            criteria.addColumnEqualTo(cod.getIndirectionTable() + "." + thisClassFks[i],
values[i].getValue());
  +            criteria.addEqualTo(cod.getIndirectionTable() + "." + thisClassFks[i], values[i].getValue());
           }
           for (int i = 0; i < itemClassFks.length; i++)
           {
  -            criteria.addColumnEqualToField(cod.getIndirectionTable() + "." + itemClassFks[i],
  +            criteria.addEqualToField(cod.getIndirectionTable() + "." + itemClassFks[i],
                       refCld.getPkFields()[i].getAttributeName());
           }
   
  
  
  
  No                   revision
  No                   revision
  1.75.2.12 +4 -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.75.2.11
  retrieving revision 1.75.2.12
  diff -u -r1.75.2.11 -r1.75.2.12
  --- SqlQueryStatement.java	26 Oct 2005 19:35:35 -0000	1.75.2.11
  +++ SqlQueryStatement.java	28 Oct 2005 19:48:06 -0000	1.75.2.12
  @@ -61,6 +61,7 @@
   public abstract class SqlQueryStatement implements SqlStatement, JoinSyntaxTypes
   {
       private static final String ALIAS_SEPARATOR = ".";
  +    private static final String M_N_ALIAS = "M_N";
       
       private SqlQueryStatement m_parentStatement;
       /** the logger */
  @@ -130,7 +131,7 @@
           if (m_query instanceof MtoNQuery)
           {
               MtoNQuery mnQuery = (MtoNQuery)m_query; 
  -            TableAlias mnAlias = new TableAlias(mnQuery.getIndirectionTable(), "M_N");
  +            TableAlias mnAlias = new TableAlias(mnQuery.getIndirectionTable(), M_N_ALIAS);
               m_pathToAlias.put(mnQuery.getIndirectionTable(), mnAlias);
           }
   
  @@ -251,7 +252,7 @@
           }
   
           // BRJ: special alias for the indirection table has no ClassDescriptor 
  -        if (aTableAlias.cld == null)
  +        if (aTableAlias.cld == null && M_N_ALIAS.equals(aTableAlias.alias))
           {
               return getIndirectionTableColName(aTableAlias, aPathInfo.path);
           }
  
  
  

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