db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1634286 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java
Date Sun, 26 Oct 2014 09:01:35 GMT
Author: tfischer
Date: Sun Oct 26 09:01:35 2014
New Revision: 1634286

URL: http://svn.apache.org/r1634286
Log:
Improve code readability, fix comments

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java?rev=1634286&r1=1634285&r2=1634286&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java
Sun Oct 26 09:01:35 2014
@@ -57,13 +57,13 @@ public class ObjectOrColumnPsPartBuilder
         throws TorqueException
     {
         PreparedStatementPart result = new PreparedStatementPart();
+        // check column
         if (toBuildFrom instanceof Column)
         {
             Column column = (Column) toBuildFrom;
             if (ignoreCase)
             {
-                result.getSql().append(
-                        adapter.ignoreCase(column.getSqlExpression()));
+                result.getSql().append(adapter.ignoreCase(column.getSqlExpression()));
             }
             else
             {
@@ -72,24 +72,21 @@ public class ObjectOrColumnPsPartBuilder
             return result;
         }
 
-        // plain object
-
+        // check subselect
         if (toBuildFrom instanceof Criteria)
         {
-            Query subquery = SqlBuilder.buildQuery(
-                    (Criteria) toBuildFrom);
+            Query subquery = SqlBuilder.buildQuery((Criteria) toBuildFrom);
             result.getPreparedStatementReplacements().addAll(
                     subquery.getPreparedStatementReplacements());
             result.getSql().append("(").append(subquery.toString()).append(")");
             return result;
         }
 
+        // plain object
         if (toBuildFrom.equals(
                 SqlEnum.CURRENT_DATE)
-                || toBuildFrom.equals(
-                        SqlEnum.CURRENT_TIME)
-                || toBuildFrom.equals(
-                        SqlEnum.CURRENT_TIMESTAMP))
+                || toBuildFrom.equals(SqlEnum.CURRENT_TIME)
+                || toBuildFrom.equals(SqlEnum.CURRENT_TIMESTAMP))
         {
             result.getSql().append(toBuildFrom.toString());
             return result;



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message