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, 10 Jun 2005 16:47:06 GMT
brj         2005/06/10 09:47:06

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql Tag:
                        OJB_1_0_RELEASE SqlQueryStatement.java
  Log:
  fixed some NPE in join handling
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.75.2.8  +21 -16    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.7
  retrieving revision 1.75.2.8
  diff -u -r1.75.2.7 -r1.75.2.8
  --- SqlQueryStatement.java	8 Jun 2005 19:45:30 -0000	1.75.2.7
  +++ SqlQueryStatement.java	10 Jun 2005 16:47:06 -0000	1.75.2.8
  @@ -1110,7 +1110,10 @@
   				{
   					TableAlias ordAlias = getTableAliasForClassDescriptor(ord.getClassDescriptor());
   					Join join = prev.getJoin(ordAlias);
  -					join.isOuter = join.isOuter || outer;
  +                    if (join != null)
  +                    {
  +                        join.isOuter = join.isOuter || outer;
  +                    }    
   				    prev = ordAlias;
   				}	
   
  @@ -1959,20 +1962,22 @@
            */
           Join getJoin(TableAlias anAlias)
           {
  -        	Join result = null;
  -        	
  -        	Iterator iter = joins.iterator() ;
  -        	while (iter.hasNext())
  -        	{
  -        		Join join = (Join) iter.next();
  -        		if (join.right.equals(anAlias))
  -        		{
  -        			result = join;
  -        			break;
  -        		}
  -        	}
  -        	
  -        	return result;
  +            Join result = null;
  +
  +            if (joins != null)
  +            {
  +                Iterator iter = joins.iterator();
  +                while (iter.hasNext())
  +                {
  +                    Join join = (Join) iter.next();
  +                    if (join.right.equals(anAlias))
  +                    {
  +                        result = join;
  +                        break;
  +                    }
  +                }
  +            }
  +            return result;
           }
           
           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