Hello,
For some case, I need a relative object call during run save method.
In that case, if criteria is different, the $collName is reset.
than $collName can not completely finish.
Here is a patch for that case.
Index: templates/trunk/src/templates/om/Object.vm
===================================================================
--- templates/trunk/src/templates/om/Object.vm (revision 394586)
+++ templates/trunk/src/templates/om/Object.vm (working copy)
@@ -1315,9 +1315,10 @@
#if ($objectIsCaching)
if ($collName != null)
{
- for (int i = 0; i < ${collName}.size(); i++)
+ final List list = new ArrayList($collName);
+ for (int i = 0; i < list.size(); i++)
{
- ((${className}) ${collName}.get(i)).save(con);
+ ((${className}) list.get(i)).save(con);
}
}
#end
Index: templates/trunk/src/templates/om/ObjectWithManager.vm
===================================================================
--- templates/trunk/src/templates/om/ObjectWithManager.vm (revision
394586)
+++ templates/trunk/src/templates/om/ObjectWithManager.vm (working copy)
@@ -1322,9 +1322,10 @@
#if ($objectIsCaching)
if ($collName != null)
{
- for (int i = 0; i < ${collName}.size(); i++)
+ final List list = new ArrayList($collName);
+ for (int i = 0; i < list.size(); i++)
{
- ((${className}) ${collName}.get(i)).save(con);
+ ((${className}) list.get(i)).save(con);
}
}
#end
Thanks,
Youngho