I look through the internet and I didnt find yet an answer for my question. Should be pretty easy:
class Parent {
String name
Child child
}
When I have a child object, how can I get the Parent by it?
like:
def Parent = Parent.findByChild(child)
How am I able to get a Parent object by it child?
thanks
Where have you looked?
Are these domain classes? If so, then you can connect them via has_many and belongs_to:
Then you can just write
child.parent