db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r452274 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
Date Tue, 03 Oct 2006 00:02:09 GMT
Author: arminw
Date: Mon Oct  2 17:02:08 2006
New Revision: 452274

URL: http://svn.apache.org/viewvc?view=rev&rev=452274
Log:
use sub-select class when build sub-select, code cleanup

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java?view=diff&rev=452274&r1=452273&r2=452274
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
Mon Oct  2 17:02:08 2006
@@ -187,8 +187,7 @@
      */
     protected AttributeInfo getAttributeInfo(String attr, boolean useOuterJoins, UserAlias
aUserAlias, Map pathClasses)
     {
-        AttributeInfo result = new AttributeInfo(attr);
-
+        AttributeInfo result;
         StringTokenizer st = SqlHelper.tokenizeAttribute(attr);
         result = new AttributeInfo(attr);
 
@@ -271,12 +270,7 @@
 	}
 
     /**
-     * Add the Column to the StringBuffer <br>
-     *
-     * @param aTableAlias
-     * @param aPathInfo
-     * @param translate flag to indicate translation of pathInfo
-     * @param buf
+     * Add the Column to the StringBuffer
      */
     protected void appendColumn(SingleAttributeInfo anAttrInfo, boolean translate, StringBuffer
buf)
     {
@@ -310,7 +304,7 @@
         colName = fld.getColumnName();
                 
         // added to support the super reference descriptor,  use the corresponding tableAlias

-        if (!fld.getClassDescriptor().equals(tableAlias.cld) && tableAlias.hasJoins())
+        if (tableAlias != null && !fld.getClassDescriptor().equals(tableAlias.cld)
&& tableAlias.hasJoins())
         {
             tableAlias = getTableAliasForClassDescriptor(fld.getClassDescriptor());
         }
@@ -714,11 +708,6 @@
 
     /**
      * Answer the SQL-Clause for a BetweenCriteria
-     *
-     * @param alias
-     * @param pathInfo
-     * @param c BetweenCriteria
-     * @param buf
      */
     private void appendBetweenCriteria(AttributeInfo attrInfo, BetweenCriteria c, StringBuffer
buf)
     {
@@ -764,25 +753,20 @@
         }
     }
 
-    /**
-     * Get the column name from the indirection table.
-     * @param mnAlias 
-     * @param path
-     */
-    private String getIndirectionTableColName(TableAlias mnAlias, String path)
-    {
-        int dotIdx = path.lastIndexOf(".");
-        String column = path.substring(dotIdx);
-        return mnAlias.alias + column;
-    }
+//    /**
+//     * Get the column name from the indirection table.
+//     * @param mnAlias
+//     * @param path
+//     */
+//    private String getIndirectionTableColName(TableAlias mnAlias, String path)
+//    {
+//        int dotIdx = path.lastIndexOf(".");
+//        String column = path.substring(dotIdx);
+//        return mnAlias.alias + column;
+//    }
 
     /**
      * Answer the SQL-Clause for an InCriteria
-     *
-     * @param alias
-     * @param pathInfo
-     * @param c InCriteria
-     * @param buf
      */
     private void appendInCriteria(AttributeInfo attrInfo, InCriterion c, StringBuffer buf)
     {
@@ -814,11 +798,6 @@
 
     /**
      * Answer the SQL-Clause for a NullCriteria
-     *
-     * @param alias
-     * @param pathInfo
-     * @param c NullCriteria
-     * @param buf
      */
     private void appendNullCriteria(AttributeInfo attrInfo, NullCriteria c, StringBuffer
buf)
     {
@@ -865,11 +844,6 @@
 
     /**
      * Answer the SQL-Clause for a SelectionCriteria
-     *
-     * @param alias
-     * @param pathInfo
-     * @param c SelectionCriteria
-     * @param buf
      */
     protected void appendCriteria(AttributeInfo attrInfo, SelectionCriteria c, StringBuffer
buf)
     {
@@ -1021,7 +995,7 @@
         }
         else
         {
-            sql = new SqlSelectStatement(this, getPlatform(), cld, subQuery, getLogger()).getStatement();
+            sql = new SqlSubSelectStatement(this, getPlatform(), cld, subQuery, getLogger()).getStatement();
         }
 
         return sql;
@@ -1394,9 +1368,6 @@
 
     /**
      * Set the TableAlias for aPath
-     * @param aPath
-     * @param hintClasses 
-     * @param TableAlias
      */
     private void setTableAliasForPath(String aPath, List hintClasses, TableAlias anAlias)
     {



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