CAY-2330 Field based data objects
  handle properties names that are java keywords


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

Branch: refs/heads/master
Commit: 1ba6f5ece51343b22cb8252022fdaaabc146f46a
Parents: f3a350e
Author: Nikita Timofeev <stari...@gmail.com>
Authored: Tue Jul 11 14:58:43 2017 +0300
Committer: Nikita Timofeev <stari...@gmail.com>
Committed: Tue Jul 11 14:58:43 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/cayenne/blob/1ba6f5ec/cayenne-cgen/src/main/resources/templates/v4_1/singleclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-cgen/src/main/resources/templates/v4_1/singleclass.vm 
b/cayenne-cgen/src/main/resources/templates/v4_1/singleclass.vm
index 5c674dc..d1888e0 100644
--- a/cayenne-cgen/src/main/resources/templates/v4_1/singleclass.vm
+++ b/cayenne-cgen/src/main/resources/templates/v4_1/singleclass.vm
@@ -102,11 +102,11 @@ public#if("true" == "${object.isAbstract()}") 
abstract#end class ${subClassName}
 ###################
 #foreach( $attr in ${object.DeclaredAttributes} )
 #set ( $type = "$importUtils.formatJavaType(${attr.Type}, false)")
-    protected $type ${attr.Name};
+    protected $type $stringUtils.formatVariableName(${attr.Name});
 #end
 
 #foreach( $rel in ${object.DeclaredRelationships} )
-    protected Object ${rel.Name};
+    protected Object $stringUtils.formatVariableName(${rel.Name});
 #end
 
 #########################################################

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1ba6f5ec/cayenne-cgen/src/main/resources/templates/v4_1/superclass.vm
----------------------------------------------------------------------
diff --git a/cayenne-cgen/src/main/resources/templates/v4_1/superclass.vm 
b/cayenne-cgen/src/main/resources/templates/v4_1/superclass.vm
index 90bdfe2..8f8bcfe 100644
--- a/cayenne-cgen/src/main/resources/templates/v4_1/superclass.vm
+++ b/cayenne-cgen/src/main/resources/templates/v4_1/superclass.vm
@@ -110,11 +110,11 @@ public abstract class ${superClassName} extends 
${baseClassName} {
 ###################
 #foreach( $attr in ${object.DeclaredAttributes} )
 #set ( $type = "$importUtils.formatJavaType(${attr.Type})")
-    protected $type ${attr.Name};
+    protected $type $stringUtils.formatVariableName(${attr.Name});
 #end
 
 #foreach( $rel in ${object.DeclaredRelationships} )
-    protected Object ${rel.Name};
+    protected Object $stringUtils.formatVariableName(${rel.Name});
 #end
 
 #########################################################

Reply via email to