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, 03 Apr 2003 19:11:19 GMT
brj         2003/04/03 11:11:19

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        SqlQueryStatement.java
  Log:
  fixed problem with non unique alias for m:n relationship
  
  Revision  Changes    Path
  1.31      +19 -19    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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- SqlQueryStatement.java	26 Mar 2003 20:57:36 -0000	1.30
  +++ SqlQueryStatement.java	3 Apr 2003 19:11:19 -0000	1.31
  @@ -749,25 +749,25 @@
                           keys = cod.getForeignKeyFieldDescriptors(cld);
                       }
                       else
  -                    {
  -                        String mnAttrPath = attrPath + "*";
  -                        indirect = getTableAliasForPath(mnAttrPath, aUserAlias, aPath);
  -                        if (indirect == null)
  -                        {
  -                            indirect = createTableAlias(cod.getIndirectionTable(), mnAttrPath,
aUserAlias, aPath);
  -                        }
  +					{
  +						String mnAttrPath = attrPath + "*";
  +						indirect = getTableAliasForPath(mnAttrPath, aUserAlias, aPath);
  +						if (indirect == null)
  +						{
  +							indirect = createTableAlias(cod.getIndirectionTable(), mnAttrPath, aUserAlias, aPath);
   
  -                        // we need two Joins for m:n
  -                        // 1.) prev class to indirectionTable
  -                        prevKeys = prev.cld.getPkFields();
  -                        join = new Join(prev, prevKeys, indirect, cod.getFksToThisClass(),
useOuterJoins, attr + "*");
  -                        prev.addJoin(join);
  +							// we need two Joins for m:n
  +							// 1.) prev class to indirectionTable
  +							prevKeys = prev.cld.getPkFields();
  +							join = new Join(prev, prevKeys, indirect, cod.getFksToThisClass(), useOuterJoins,
attr + "*");
  +							prev.addJoin(join);
   
  -                        // 2.) indirectionTable to the current Class
  -                        prev = indirect;
  -                        prevKeys = cod.getFksToItemClass();
  -                        keys = cld.getPkFields();
  -                    }
  +							// 2.) indirectionTable to the current Class
  +							prev = indirect;
  +							prevKeys = cod.getFksToItemClass();
  +							keys = cld.getPkFields();
  +						}
  +					}
                   }
                   else
                   {
  
  
  

Mime
View raw message