greycat icon indicating copy to clipboard operation
greycat copied to clipboard

Add generated code to GCM generator

Open assaad opened this issue 6 years ago • 1 comments

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.

assaad avatar Mar 29 '18 08:03 assaad

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(); }

thomashartmann avatar Apr 13 '18 14:04 thomashartmann