db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql SqlSelectStatement.java
Date Thu, 29 Sep 2005 23:32:16 GMT
arminw      2005/09/29 16:32:16

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        SqlSelectStatement.java
  Log:
  minor cleanup
  
  Revision  Changes    Path
  1.43      +17 -18    db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java
  
  Index: SqlSelectStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- SqlSelectStatement.java	29 Sep 2005 20:36:41 -0000	1.42
  +++ SqlSelectStatement.java	29 Sep 2005 23:32:16 -0000	1.43
  @@ -43,7 +43,7 @@
   public class SqlSelectStatement extends SqlQueryStatement
   {
       private FieldDescriptor[] fieldsForSelect;
  -    
  +
       /**
        * Constructor for SqlSelectStatement.
        * @param aPlatform
  @@ -85,7 +85,7 @@
           FieldDescriptor[] fieldDescriptors = getFieldsForSelect(cld);
           ArrayList columnList = new ArrayList();
           TableAlias searchAlias = getSearchAlias();
  -        
  +
           for (int i = 0; i < fieldDescriptors.length; i++)
           {
               FieldDescriptor field = fieldDescriptors[i];
  @@ -101,7 +101,7 @@
               appendColumn(alias, field.getColumnName(), buf);
               columnList.add(field.getAttributeName());
           }
  -        
  +
           appendClazzColumnForSelect(cld, buf);
           return columnList;
       }
  @@ -113,7 +113,7 @@
       {
           return getMultiJoinedClassDescriptors(getSearchClassDescriptor());
       }
  -        
  +
       /**
        * Get MultiJoined ClassDescriptors
        * @param cld
  @@ -123,18 +123,17 @@
           DescriptorRepository repository = cld.getRepository();
           Class[] multiJoinedClasses = repository.getSubClassesMultipleJoinedTables(cld,
true);
           ClassDescriptor[] result = new ClassDescriptor[multiJoinedClasses.length];
  -                                
  +
           for (int i = 0 ; i < multiJoinedClasses.length; i++)
           {
  -            ClassDescriptor subCld = repository.getDescriptorFor(multiJoinedClasses[i]);
  -            result[i] = subCld;
  +            result[i] = repository.getDescriptorFor(multiJoinedClasses[i]);
            }
  -        
  +
           return result;
       }
   
       /**
  -     * Create the OJB_CLAZZ pseudo column based on CASE WHEN. 
  +     * Create the OJB_CLAZZ pseudo column based on CASE WHEN.
        * This column defines the Class to be instantiated.
        * @param cld
        * @param buf
  @@ -147,7 +146,7 @@
           {
               return;
           }
  -        
  +
           buf.append(",CASE");
   
           for (int i = clds.length; i > 0; i--)
  @@ -168,10 +167,10 @@
                   appendColumn(alias, field.getColumnName(), buf);
                   buf.append(" IS NOT NULL");
               }
  -            buf.append(" THEN '" + subCld.getClassNameOfObject() + "'");
  +            buf.append(" THEN '").append(subCld.getClassNameOfObject()).append("'");
           }
  -        buf.append(" ELSE '" + cld.getClassNameOfObject() + "'");
  -        buf.append(" END AS " + SqlHelper.OJB_CLASS_COLUMN);       
  +        buf.append(" ELSE '").append(cld.getClassNameOfObject()).append("'");
  +        buf.append(" END AS " + SqlHelper.OJB_CLASS_COLUMN);
       }
   
       /**
  @@ -196,10 +195,10 @@
           {
               fieldsForSelect = buildFieldsForSelect(cld);
           }
  -        
  +
           return fieldsForSelect;
       }
  -        
  +
       /**
        * Return the Fields to be selected.
        *
  @@ -371,7 +370,7 @@
               {
                   // then we have a super class so join tables
                   cldSuper = cld.getRepository().getDescriptorFor(cld.getSuperClass());
  -                appendSuperClassColumns(cld, cldSuper, stmt);
  +                appendSuperClassColumns(cldSuper, stmt);
               }
   
               stmt.append(" FROM ");
  @@ -428,7 +427,7 @@
           }
       }
   
  -    private void appendSuperClassColumns(ClassDescriptor cldSub, ClassDescriptor cldSuper,
StringBuffer buf)
  +    private void appendSuperClassColumns(ClassDescriptor cldSuper, StringBuffer buf)
       {
           FieldDescriptor[] fields = cldSuper.getFieldDescriptions();
           for (int i = 0; i < fields.length; i++)
  
  
  

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