Assume I have the following directed graph structure:
class GraphNode {
static hasMany = [children: GraphNode]
static hasMany = [parents: GraphNode]
static mappedBy = [children: 'parents', parents: 'children']
}
How can I restrict cycles?
Here an algorithm for that purpose: http://adhockery.blogspot.de/2010/06/acyclic-relationship-validation-in.html