cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r905087 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans: QualifierTranslator.java QueryAssemblerHelper.java
Date Sun, 31 Jan 2010 18:05:26 GMT
Author: aadamchik
Date: Sun Jan 31 18:05:26 2010
New Revision: 905087

URL: http://svn.apache.org/viewvc?rev=905087&view=rev
Log:
no changes, reformatting the code

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java?rev=905087&r1=905086&r2=905087&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
Sun Jan 31 18:05:26 2010
@@ -63,9 +63,10 @@
     protected void doAppendPart() throws IOException {
         doAppendPart(extractQualifier());
     }
-    
+
     /**
-     * Translates query qualifier to SQL WHERE clause. Qualifier is a method parameter  
  * 
+     * Translates query qualifier to SQL WHERE clause. Qualifier is a method parameter.
+     * 
      * @since 3.0
      */
     protected void doAppendPart(Expression rootNode) throws IOException {
@@ -95,7 +96,7 @@
                         : entityQualifier;
             }
         }
-        
+
         /**
          * Attaching root Db entity's qualifier
          */
@@ -103,9 +104,9 @@
             Expression dbQualifier = getDbEntity().getQualifier();
             if (dbQualifier != null) {
                 dbQualifier = dbQualifier.transform(new DbEntityQualifierTransformer());
-                
-                qualifier = qualifier == null ? dbQualifier :
-                    qualifier.andExp(dbQualifier);
+
+                qualifier = qualifier == null ? dbQualifier : qualifier
+                        .andExp(dbQualifier);
             }
         }
 
@@ -462,12 +463,14 @@
             objectMatchTranslator.setRelationship(rel, joinSplitAlias);
         }
     }
-    
+
     /**
-     * Class to translate DB Entity qualifiers annotation to Obj-entity qualifiers annotation
-     * This is done by changing all Obj-paths to Db-paths and rejecting all original Db-paths
+     * Class to translate DB Entity qualifiers annotation to Obj-entity qualifiers
+     * annotation This is done by changing all Obj-paths to Db-paths and rejecting all
+     * original Db-paths
      */
     class DbEntityQualifierTransformer implements Transformer {
+
         public Object transform(Object input) {
             if (input instanceof ASTObjPath) {
                 return new ASTDbPath(((SimpleNode) input).getOperand(0));

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java?rev=905087&r1=905086&r2=905087&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
Sun Jan 31 18:05:26 2010
@@ -58,12 +58,17 @@
     public QueryAssemblerHelper(QueryAssembler queryAssembler) {
         this.queryAssembler = queryAssembler;
         boolean status;
-        if(queryAssembler.getQueryMetadata().getDataMap()!=null && queryAssembler.getQueryMetadata().getDataMap().isQuotingSQLIdentifiers()){

-            status= true;
-        } else {
+        if (queryAssembler.getQueryMetadata().getDataMap() != null
+                && queryAssembler
+                        .getQueryMetadata()
+                        .getDataMap()
+                        .isQuotingSQLIdentifiers()) {
+            status = true;
+        }
+        else {
             status = false;
         }
-        strategy =   queryAssembler.getAdapter().getQuotingStrategy(status);
+        strategy = queryAssembler.getAdapter().getQuotingStrategy(status);
     }
 
     public ObjEntity getObjEntity() {
@@ -82,14 +87,14 @@
         doAppendPart();
         return out;
     }
-    
+
     /**
      * Sets ouput buffer
      */
     void setOut(Appendable out) {
         this.out = out;
     }
-    
+
     /**
      * @return output buffer
      */
@@ -246,7 +251,7 @@
                 }
             }
             else {
-                     processColumnWithQuoteSqlIdentifiers(component.getAttribute());
+                processColumnWithQuoteSqlIdentifiers(component.getAttribute());
             }
         }
     }
@@ -256,18 +261,19 @@
                 .getCurrentAlias() : null;
         out.append(dbAttr.getAliasedName(alias));
     }
-    
-    protected void processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr) throws IOException
{
-       
-        String alias =  (queryAssembler.supportsTableAliases()) ? queryAssembler
+
+    protected void processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr)
+            throws IOException {
+
+        String alias = (queryAssembler.supportsTableAliases()) ? queryAssembler
                 .getCurrentAlias() : null;
-      
-            if(alias != null){
-                
-                out.append(strategy.quoteString(alias));
-                out.append(".");
-            }
-            out.append(strategy.quoteString(dbAttr.getName()));                     
+
+        if (alias != null) {
+
+            out.append(strategy.quoteString(alias));
+            out.append(".");
+        }
+        out.append(strategy.quoteString(dbAttr.getName()));
     }
 
     /**



Mime
View raw message