diff --git a/src/docbkx/reference/programming-model/nodetypestrategy.xml b/src/docbkx/reference/programming-model/nodetypestrategy.xml index fb93dd6d6..87492e71e 100644 --- a/src/docbkx/reference/programming-model/nodetypestrategy.xml +++ b/src/docbkx/reference/programming-model/nodetypestrategy.xml @@ -4,20 +4,44 @@ Reified types for entities There are several ways to represent the Java type hierarchy of the data model in the graph. In general for all - node and relationship entities type information is needed to perform certain repository operations. That's - why the hierarchy up to java.lang.Object of all these classes will be persisted in the graph. - Implementations of NodeTypeStrategy take care of persisting this information on entity instance + node and relationship entities type information is needed to perform certain repository operations. Some of + this type information is saved in the graph database. + + + Implementations of NodeTypeStrategy take care of persisting this information on entity instance creation. They also provide the repository methods that use this type information to perform their operations - like findAll, count etc. + like findAll, count, etc. - The current implementation uses nodes to represent the Java type hierarchy which are connected via SUBCLASS_OF - relationships to their superclass nodes and via INSTANCE_OF relationships to the concrete node entity - instance node. + There are three available implementations to choose from. + + + SubReferenceNodeTypeStrategy + + Stores entity types in a tree in the graph representing the type hierarchy. Each entity + has a INSTANCE_OF relationship to a type node representing that entity's type. The type may or + may not have a SUBCLASS_OF relationship to another type node. + + + + IndexingNodeTypeStrategy + + Stores entity types in the integrated index. Each entity node gets indexed with its type and + any supertypes that are also @NodeEntity-annotated. The special index used for this + is called __types__. Additionally, in order to get the type of an entity node, each + node has a property __type__ with the type of that entity. + + + + NoopNodeTypeStrategy + + Does not store any type information, and does hence not support finding by type, counting by type, + or retrieving the type of any entity. + + + - An alternative approach could use indexing operations to perform the same functionality. Or one could skip the - NodeTypeStrategy altogether if no strict checks on type conformity are needed, which would allow for a much - more flexible data model. + The default implementation is SubReferenceNodeTypeStrategy. \ No newline at end of file