Permalink
Browse files

ignoring properties which have been already process in children

  • Loading branch information...
1 parent 6101b57 commit 17d2cbff16b47cac13801c3843578eca9414f6b7 @musketyr musketyr committed Aug 28, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 core/src/main/groovyx/gaelyk/datastore/EntityTransformation.groovy
View
7 core/src/main/groovyx/gaelyk/datastore/EntityTransformation.groovy
@@ -380,11 +380,12 @@ class EntityTransformation extends AbstractASTTransformation {
)
}
- private void eachPropertyIncludingSuper(ClassNode parent, Closure iterator){
- parent.properties.each iterator
+ private void eachPropertyIncludingSuper(ClassNode parent, Closure iterator, List<String> alreadyProcessed = []){
+ parent.properties.findAll{ !(it.name in alreadyProcessed) }.each iterator
+ alreadyProcessed.addAll(parent.properties*.name)
ClassNode superNode = parent.superClass
if(superNode && superNode != ClassHelper.OBJECT_TYPE){
- eachPropertyIncludingSuper(superNode, iterator)
+ eachPropertyIncludingSuper(superNode, iterator, alreadyProcessed)
}
}

0 comments on commit 17d2cbf

Please sign in to comment.