cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r705992 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2: datamap-subclass.vm datamap-superclass.vm
Date Sun, 19 Oct 2008 12:00:36 GMT
Author: aadamchik
Date: Sun Oct 19 05:00:35 2008
New Revision: 705992

URL: http://svn.apache.org/viewvc?rev=705992&view=rev
Log:
CAY-1070 Generating Query and Procedure Access Code

generated code formatting consistency; removing unused imports

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-subclass.vm
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-superclass.vm

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-subclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-subclass.vm?rev=705992&r1=705991&r2=705992&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-subclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-subclass.vm
Sun Oct 19 05:00:35 2008
@@ -33,16 +33,15 @@
 
 public class ${subClassName} extends ${superClassName} {
 
-  private static ${subClassName} instance;
+    private static ${subClassName} instance;
 
-  private ${subClassName}() {}
+    private ${subClassName}() {}
 
-  public static ${subClassName} getInstance() {
-    if( instance == null) {
-      instance = new ${subClassName}();
-    }
-
-    return instance;
-  }
+    public static ${subClassName} getInstance() {
+        if(instance == null) {
+            instance = new ${subClassName}();
+        }
 
+        return instance;
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-superclass.vm?rev=705992&r1=705991&r2=705992&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-superclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/datamap-superclass.vm
Sun Oct 19 05:00:35 2008
@@ -35,8 +35,6 @@
 ${importUtils.addReservedType("${superPackageName}.${superClassName}")}##
 ${importUtils.addType("${basePackageName}.${baseClassName}")}##
 ${importUtils.addType('java.util.List')}##
-${importUtils.addType('java.util.Map')}##
-${importUtils.addType('java.util.HashMap')}##
 ${importUtils.addType('org.apache.cayenne.ObjectContext')}##
 ${importUtils.addType('org.apache.cayenne.query.NamedQuery')}##
 #foreach( $selectQuery in ${object.SelectQueries})
@@ -54,26 +52,24 @@
  * If you need to make any customizations, please use subclass.
  */
 public class ${superClassName} {
-
 #foreach( $selectQuery in ${object.SelectQueries})
-    public List<${stringUtils.stripPackageName($selectQuery.Root.ClassName)}> perform${dataMapUtils.getQueryMethodName(${selectQuery})}(ObjectContext
context #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})}), ${stringUtils.stripPackageName(${dataMapUtils.getParameterType(${selectQuery},
${parameter})})} ${parameter} #end) {
-    #if(${dataMapUtils.hasParameters($selectQuery)})
-      String[] parameters = new String[] {
-      #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
-      "${parameter}",
-      #end
-      };
 
-      Object[] values = new Object[] {
-      #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
-      ${parameter},
-      #end
-      };
-    #end
+    public List<${stringUtils.stripPackageName($selectQuery.Root.ClassName)}> perform${dataMapUtils.getQueryMethodName(${selectQuery})}(ObjectContext
context #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})}), ${stringUtils.stripPackageName(${dataMapUtils.getParameterType(${selectQuery},
${parameter})})} ${parameter}#end) {
+#if(${dataMapUtils.hasParameters($selectQuery)})
+        String[] parameters = {
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+            "${parameter}",
+#end
+        };
 
-      NamedQuery query = new NamedQuery("${selectQuery.Name}"#if(${dataMapUtils.hasParameters($selectQuery)}),
parameters, values#end);
-      return context.performQuery(query);
+        Object[] values = {
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+            ${parameter},
+#end
+        };
+
+#end
+        return context.performQuery(new NamedQuery("${selectQuery.Name}"#if(${dataMapUtils.hasParameters($selectQuery)}),
parameters, values#end));
     }
-    
 #end
 }
\ No newline at end of file



Mime
View raw message