greycat
greycat copied to clipboard
Add generated code to GCM generator
It would be great to generate getter for indexes, relations, and references from the GCM model. get(IndexName)Index, get(RelationName)Relation, get(ReferenceName)Reference
Use case of this: when we want to check the size of the subnodes indexed or pointed by a relationship without actually resolving them.
In case of bidirectional relations, this would allow you to use the generated API to create inconsistencies. I would rather propose to generate methods to get the size and/or keys of the relation without resolving the relation rather than return the Relation object itself. Something like:
public int getRelationNameSize() { return ((Relation) this.get(RELATIONNAME.name)).size(); }