cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: Fix imports for v4.1 DataMap templates
Date Tue, 19 Sep 2017 07:41:08 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 4a6241641 -> 73c4f7640


Fix imports for v4.1 DataMap templates


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/73c4f764
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/73c4f764
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/73c4f764

Branch: refs/heads/master
Commit: 73c4f76403c087a8127d9490ef87866b90ef6301
Parents: 4a62416
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Tue Sep 19 10:41:03 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Tue Sep 19 10:41:03 2017 +0300

----------------------------------------------------------------------
 .../src/main/resources/templates/v4_1/datamap-singleclass.vm | 8 +++++---
 .../src/main/resources/templates/v4_1/datamap-superclass.vm  | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/73c4f764/cayenne-cgen/src/main/resources/templates/v4_1/datamap-singleclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-cgen/src/main/resources/templates/v4_1/datamap-singleclass.vm b/cayenne-cgen/src/main/resources/templates/v4_1/datamap-singleclass.vm
index 52fcf17..31d0c33 100644
--- a/cayenne-cgen/src/main/resources/templates/v4_1/datamap-singleclass.vm
+++ b/cayenne-cgen/src/main/resources/templates/v4_1/datamap-singleclass.vm
@@ -35,23 +35,25 @@
 ##
 ${importUtils.setPackage($subPackageName)}##
 ${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
-${importUtils.addType("${basePackageName}.${baseClassName}")}##
-${importUtils.addType('java.util.List')}##
 ${importUtils.addType('org.apache.cayenne.ObjectContext')}##
+#if( ${object.hasSelectQueries()} )
+${importUtils.addType('java.util.List')}##
 ${importUtils.addType('org.apache.cayenne.query.MappedSelect')}##
 #foreach( $selectQuery in ${object.SelectQueries})
 ${importUtils.addType(${selectQuery.Root.ClassName})}##
+#if(${dataMapUtils.isValidParameterNames($selectQuery)})
 #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
 ${importUtils.addType(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})}##
 #end##
 #end##
+#end##
+#end##
 #if($object.hasExecQueries())##
 ${importUtils.addType('java.util.Map')}##
 ${importUtils.addType('org.apache.cayenne.QueryResult')}##
 ${importUtils.addType('org.apache.cayenne.query.MappedExec')}##
 #end##
 ${importUtils.generate()}
-
 /**
  * This class was generated by Cayenne.
  * It is probably a good idea to avoid changing this class manually,

http://git-wip-us.apache.org/repos/asf/cayenne/blob/73c4f764/cayenne-cgen/src/main/resources/templates/v4_1/datamap-superclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-cgen/src/main/resources/templates/v4_1/datamap-superclass.vm b/cayenne-cgen/src/main/resources/templates/v4_1/datamap-superclass.vm
index bea1a56..e5f5ea0 100644
--- a/cayenne-cgen/src/main/resources/templates/v4_1/datamap-superclass.vm
+++ b/cayenne-cgen/src/main/resources/templates/v4_1/datamap-superclass.vm
@@ -34,9 +34,9 @@
 ${importUtils.setPackage($superPackageName)}##
 #if(${superPackageName})${importUtils.addReservedType("${superPackageName}.${superClassName}")}#end##
 #if(${basePackageName})${importUtils.addType("${basePackageName}.${baseClassName}")}#end##
+${importUtils.addType('org.apache.cayenne.ObjectContext')}##
 #if( ${object.hasSelectQueries()} )
 ${importUtils.addType('java.util.List')}##
-${importUtils.addType('org.apache.cayenne.ObjectContext')}##
 ${importUtils.addType('org.apache.cayenne.query.MappedSelect')}##
 #foreach( $selectQuery in ${object.SelectQueries})
 ${importUtils.addType(${selectQuery.Root.ClassName})}##


Mime
View raw message