cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1381722 - in /cayenne/main/trunk/framework/cayenne-tools/src: main/resources/templates/v1_2/ test/java/org/apache/cayenne/gen/
Date Thu, 06 Sep 2012 19:19:29 GMT
Author: aadamchik
Date: Thu Sep  6 19:19:29 2012
New Revision: 1381722

URL: http://svn.apache.org/viewvc?rev=1381722&view=rev
Log:
CAY-1724 Add 'Property' class for easier and better Expression creation

adding @Deprecated annotation to String properties

Modified:
    cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
    cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm
    cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm
    cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/light-superclass.vm
    cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
    cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
    cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
Thu Sep  6 19:19:29 2012
@@ -64,27 +64,29 @@ public abstract class ${superClassName} 
 
 ## Create ivars names
 #foreach( $attr in ${object.DeclaredAttributes} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY
= "${attr.Name}";
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY =
"${rel.Name}";
 #end
 
 ## Create Properties
 #foreach( $attr in ${object.DeclaredAttributes} )
-    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>("${attr.Name}");
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
 #if( $rel.ToMany )
 #if ( ${rel.CollectionType} == "java.util.Map")
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)>" )
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #else
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>"
)
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #end
 #else
-    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>("${rel.Name}");
 #end
 #end
 

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm
Thu Sep  6 19:19:29 2012
@@ -48,12 +48,13 @@ public abstract class ${subClassName} ex
 
 ## Create property names
 #foreach( $attr in ${object.Attributes} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY
= "${attr.Name}";
 #end
 
 ## Create Properties
 #foreach( $attr in ${object.Attributes} )
-    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>("${attr.Name}");
 #end
 
     // special properties injected by Cayenne

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm
Thu Sep  6 19:19:29 2012
@@ -54,12 +54,13 @@ public abstract class ${superClassName} 
 
 ## Create property names
 #foreach( $attr in ${object.Attributes} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY
= "${attr.Name}";
 #end
 
 ## Create Properties
 #foreach( $attr in ${object.Attributes} )
-    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>("${attr.Name}");
 #end
 
     // special properties injected by Cayenne

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/light-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/light-superclass.vm?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/light-superclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/light-superclass.vm
Thu Sep  6 19:19:29 2012
@@ -60,27 +60,29 @@ public abstract class ${superClassName} 
 
 ## Create ivars names
 #foreach( $attr in ${object.DeclaredAttributes} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY
= "${attr.Name}";
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY =
"${rel.Name}";
 #end
 
 ## Create Properties
 #foreach( $attr in ${object.DeclaredAttributes} )
-    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>("${attr.Name}");
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
 #if( $rel.ToMany )
 #if ( ${rel.CollectionType} == "java.util.Map")
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)>" )
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #else
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>"
)
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #end
 #else
-    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>("${rel.Name}");
 #end
 #end
 

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
Thu Sep  6 19:19:29 2012
@@ -52,9 +52,11 @@ public#if("true" == "${object.getIsAbstr
 
 ## Create property names
 #foreach( $attr in ${object.DeclaredAttributes} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY
= "${attr.Name}";
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY =
"${rel.Name}";
 #end
 
@@ -66,19 +68,19 @@ public#if("true" == "${object.getIsAbstr
 
 ## Create Properties
 #foreach( $attr in ${object.DeclaredAttributes} )
-    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>("${attr.Name}");
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
 #if( $rel.ToMany )
 #if ( ${rel.CollectionType} == "java.util.Map")
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)>" )
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #else
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>"
)
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #end
 #else
-    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>("${rel.Name}");
 #end
 #end
 

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
Thu Sep  6 19:19:29 2012
@@ -57,9 +57,11 @@ public abstract class ${superClassName} 
 
 ## Create property names
 #foreach( $attr in ${object.DeclaredAttributes} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY
= "${attr.Name}";
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
+    @Deprecated
     public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY =
"${rel.Name}";
 #end
 
@@ -71,19 +73,19 @@ public abstract class ${superClassName} 
 
 ## Create Properties
 #foreach( $attr in ${object.DeclaredAttributes} )
-    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${attr.Type}, false)>
${stringUtils.capitalizedAsConstant($attr.Name)} = new Property<$importUtils.formatJavaType(${attr.Type},
false)>("${attr.Name}");
 #end
 #foreach( $rel in ${object.DeclaredRelationships} )
 #if( $rel.ToMany )
 #if ( ${rel.CollectionType} == "java.util.Map")
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)>" )
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #else
     #set( $type = "$importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>"
)
-    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$type> ${stringUtils.capitalizedAsConstant($rel.Name)}
= new Property<$type>("${rel.Name}");
 #end
 #else
-    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+    public static final Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>
${stringUtils.capitalizedAsConstant($rel.Name)} = new Property<$importUtils.formatJavaType(${rel.TargetEntity.ClassName})>("${rel.Name}");
 #end
 #end
 
@@ -91,22 +93,22 @@ public abstract class ${superClassName} 
 #foreach( $attr in ${object.DeclaredAttributes} )
 #if ("true" != "${object.isReadOnly()}")
     public void set${stringUtils.capitalized($attr.Name)}($importUtils.formatJavaType(${attr.Type})
$stringUtils.formatVariableName(${attr.Name})) {
-        writeProperty(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY, $stringUtils.formatVariableName(${attr.Name}));
+        writeProperty("${attr.Name}", $stringUtils.formatVariableName(${attr.Name}));
     }
 #end
 #if ( $importUtils.isBoolean(${attr.Type}) )
 	public boolean is${stringUtils.capitalized($attr.Name)}() {
-        Boolean value = (Boolean)readProperty(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+        Boolean value = (Boolean)readProperty("${attr.Name}");
         return (value != null) ? value.booleanValue() : false;
     }
 #elseif ( $importUtils.isNonBooleanPrimitive(${attr.Type}) )
     public ${importUtils.formatJavaType($attr.Type)} get${stringUtils.capitalized($attr.Name)}()
{
-        Object value = readProperty(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+        Object value = readProperty("${attr.Name}");
         return (value != null) ? ($importUtils.formatJavaTypeAsNonBooleanPrimitive(${attr.Type}))
value : 0;
     }
 #else
     public $importUtils.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}()
{
-        return ($importUtils.formatJavaType(${attr.Type}))readProperty(${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY);
+        return ($importUtils.formatJavaType(${attr.Type}))readProperty("${attr.Name}");
     }
 #end
 
@@ -117,31 +119,31 @@ public abstract class ${superClassName} 
 #if( $rel.ToMany )
 #if ( ! $rel.ReadOnly )
     public void addTo${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName})
obj) {
-        addToManyTarget(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY, obj, true);
+        addToManyTarget("${rel.Name}", obj, true);
     }
     public void removeFrom${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName})
obj) {
-        removeToManyTarget(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY, obj,
true);
+        removeToManyTarget("${rel.Name}", obj, true);
     }
 #end
     @SuppressWarnings("unchecked")
 #if ( ${rel.CollectionType} == "java.util.Map")
     public $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)> get${stringUtils.capitalized($rel.Name)}()
{
-        return ($importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)>)readProperty(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+        return ($importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)),
$importUtils.formatJavaType($rel.TargetEntity.ClassName)>)readProperty("${rel.Name}");
     }
 #else
     public $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>
get${stringUtils.capitalized($rel.Name)}() {
-        return ($importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>)readProperty(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+        return ($importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>)readProperty("${rel.Name}");
     }
 #end
 #else
 #if ( !${object.isReadOnly()} && !$rel.ReadOnly )
     public void set${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName})
$stringUtils.formatVariableName(${rel.name})) {
-        setToOneTarget(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY, $stringUtils.formatVariableName(${rel.name}),
true);
+        setToOneTarget("${rel.Name}", $stringUtils.formatVariableName(${rel.name}), true);
     }
 #end
 
     public $importUtils.formatJavaType(${rel.TargetEntity.ClassName}) get${stringUtils.capitalized($rel.Name)}()
{
-        return ($importUtils.formatJavaType(${rel.TargetEntity.ClassName}))readProperty(${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY);
+        return ($importUtils.formatJavaType(${rel.TargetEntity.ClassName}))readProperty("${rel.Name}");
     }
 #end
 

Modified: cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java?rev=1381722&r1=1381721&r2=1381722&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
Thu Sep  6 19:19:29 2012
@@ -143,17 +143,17 @@ public class ClassGenerationActionTest e
         String superclass = generated.get(0);
         
         assertTrue(superclass, superclass.contains("public void setID(int ID)"));
-        assertTrue(superclass, superclass.contains("writeProperty(ID_PROPERTY, ID);"));
+        assertTrue(superclass, superclass.contains("writeProperty(\"ID\", ID);"));
         
         assertTrue(superclass, superclass.contains("public int getID()"));
-        assertTrue(superclass, superclass.contains("Object value = readProperty(ID_PROPERTY);"));
+        assertTrue(superclass, superclass.contains("Object value = readProperty(\"ID\");"));
         assertTrue(superclass, superclass.contains("return (value != null) ? (Integer) value
: 0;"));
         
         assertTrue(superclass, superclass.contains("public void setName(char name)"));
-        assertTrue(superclass, superclass.contains("writeProperty(NAME_PROPERTY, name);"));
+        assertTrue(superclass, superclass.contains("writeProperty(\"name\", name);"));
         
         assertTrue(superclass, superclass.contains("public char getName()"));
-        assertTrue(superclass, superclass.contains("Object value = readProperty(NAME_PROPERTY);"));
+        assertTrue(superclass, superclass.contains("Object value = readProperty(\"name\");"));
         assertTrue(superclass, superclass.contains("return (value != null) ? (Character)
value : 0;"));
 
     }



Mime
View raw message