You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by sk...@apache.org on 2015/04/29 11:32:25 UTC

cayenne git commit: CAY-1999 | add Property import for relationships

Repository: cayenne
Updated Branches:
  refs/heads/master 3cfce77cb -> 317f81090


CAY-1999 | add Property import for relationships


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

Branch: refs/heads/master
Commit: 317f81090d450abe5d58dd28feeedd9e46faa6e2
Parents: 3cfce77
Author: Savva Kolbachev <s....@gmail.com>
Authored: Wed Apr 29 11:55:24 2015 +0300
Committer: Savva Kolbachev <s....@gmail.com>
Committed: Wed Apr 29 12:31:51 2015 +0300

----------------------------------------------------------------------
 .../resources/templates/v1_2/client-superclass.vm    |  3 ++-
 .../src/main/resources/templates/v1_2/singleclass.vm | 15 ++++++++-------
 .../src/main/resources/templates/v1_2/superclass.vm  |  3 ++-
 3 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/317f8109/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm b/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
index b723bf1..7d8117c 100644
--- a/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
+++ b/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
@@ -36,7 +36,8 @@
 ${importUtils.setPackage($superPackageName)}##
 ${importUtils.addReservedType("${$superPackageName}.${superClassName}")}##
 ${importUtils.addType("${basePackageName}.${baseClassName}")}##
-#if(${object.DeclaredAttributes} and !${object.DeclaredAttributes.isEmpty()})
+#if((${object.DeclaredAttributes} and !${object.DeclaredAttributes.isEmpty()})
+or (${object.DeclaredRelationships} and !${object.DeclaredRelationships.isEmpty()}))
 ${importUtils.addType('org.apache.cayenne.exp.Property')}##
 #end
 #foreach( $attr in ${object.DeclaredAttributes} )

http://git-wip-us.apache.org/repos/asf/cayenne/blob/317f8109/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm b/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
index 64815d3..cf3e80d 100644
--- a/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
+++ b/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
@@ -36,7 +36,8 @@
 ${importUtils.setPackage($subPackageName)}##
 ${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
 ${importUtils.addType("${basePackageName}.${baseClassName}")}##
-#if(${object.DeclaredAttributes} and !${object.DeclaredAttributes.isEmpty()})
+#if((${object.DeclaredAttributes} and !${object.DeclaredAttributes.isEmpty()})
+or (${object.DeclaredRelationships} and !${object.DeclaredRelationships.isEmpty()}))
 ${importUtils.addType('org.apache.cayenne.exp.Property')}##
 #end
 #foreach( $attr in ${object.DeclaredAttributes} )
@@ -44,7 +45,7 @@ $importUtils.addType(${attr.Type})##
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
 $importUtils.addType(${rel.TargetEntity.ClassName})##
-#if(${rel.CollectionType}) 
+#if(${rel.CollectionType})
 $importUtils.addType(${rel.CollectionType})##
 #end
 #end
@@ -52,8 +53,8 @@ ${importUtils.generate()}
 
 public#if("true" == "${object.getIsAbstract()}") abstract#end class ${subClassName} extends ${baseClassName} {
 
-    private static final long serialVersionUID = 1L; 
-     
+    private static final long serialVersionUID = 1L;
+
 ## Create property names
 #if( $createPropertyNames )
 #foreach( $attr in ${object.DeclaredAttributes} )
@@ -134,10 +135,10 @@ public#if("true" == "${object.getIsAbstract()}") abstract#end class ${subClassNa
 #end
     public $importUtils.formatJavaType(${rel.TargetEntity.ClassName}) get${stringUtils.capitalized($rel.Name)}() {
         return ($importUtils.formatJavaType(${rel.TargetEntity.ClassName}))readProperty("${rel.name}");
-    } 
+    }
 #end
-    
-    
+
+
 #end
 }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/317f8109/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm b/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
index 8586216..36747ac 100644
--- a/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
+++ b/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
@@ -35,7 +35,8 @@
 ${importUtils.setPackage($superPackageName)}##
 ${importUtils.addReservedType("${superPackageName}.${superClassName}")}##
 ${importUtils.addType("${basePackageName}.${baseClassName}")}##
-#if(${object.DeclaredAttributes} and !${object.DeclaredAttributes.isEmpty()})
+#if((${object.DeclaredAttributes} and !${object.DeclaredAttributes.isEmpty()})
+or (${object.DeclaredRelationships} and !${object.DeclaredRelationships.isEmpty()}))
 ${importUtils.addType('org.apache.cayenne.exp.Property')}##
 #end
 #foreach( $attr in ${object.DeclaredAttributes} )