build new obj with parent information
I dont know if this is possible but what I want to do is:
def par = Participant.get(0)
new Winner(par)
explaining the code above: Pa开发者_StackOverflow社区rticipant is parent class of Winner, so I wanna create a Winner instance but copying all the fields which are filled in that participant.
Is that possible?! thanks!
Try this:
new Winner(par.properties)
Maybe:
def par = Participant.get(0)
def winner = new Winner()
bindData(winner, par)
精彩评论