|
From: Chris M. <cm...@us...> - 2007-10-05 15:55:32
|
User: cmicali
Date: 07/10/05 08:55:35
Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl
Log:
Fix for [NETCART-5]
- Modified constructors in ValueObject.vsl to call parent constructors if there is a parent class
Revision Changes Path
1.7 +21 -5 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl
Index: ValueObject.vsl
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- ValueObject.vsl 5 Oct 2007 14:07:04 -0000 1.6
+++ ValueObject.vsl 5 Oct 2007 15:55:34 -0000 1.7
@@ -57,21 +57,29 @@
#end
#if ($enablePropertyConstructors.equalsIgnoreCase('true'))
-#set ($propertiesNumber = $class.properties.size())
-#if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.properties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName))
+#set ($propertiesNumber = $class.allProperties.size())
+#if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.allProperties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName))
/// <summary>
/// Constructor taking all properties.
/// </summary>
#set ($parenthesis = "(")
-#if ($class.properties.empty)
+#if ($class.allProperties.empty)
#set ($parenthesis = "()")
#end
public ${class.name}${parenthesis}
-#foreach ($property in $class.properties)
- $property.getterSetterTypeName ${property.name}#if($velocityCount != $class.properties.size()),#else)
+#foreach ($property in $class.allProperties)
+ $property.getterSetterTypeName ${property.name}#if($velocityCount != $class.allProperties.size()),#else)
#end
#end
+#if($class.generalization)
+ : base(#set ($comma = "")
+#foreach ($property in $class.generalization.allProperties)
+${comma}${property.name}## no newline
+#set ($comma = ", ")
+#end
+)
+#end
{
#foreach ($property in $class.properties)
this.${attributeNamePrefix}${property.name} = ${property.name};
@@ -84,6 +92,14 @@
/// Copy constructor
/// </summary>
public ${class.name}(${class.name} other${class.name})
+#if($class.generalization)
+ : base(#set ($comma = "")
+#foreach ($property in $class.generalization.allProperties)
+${comma}other${class.name}.${property.name}## no newline
+#set ($comma = ", ")
+#end
+)
+#end
{
if (other${class.name} != null)
{
|