Database Reference
In-Depth Information
Note
If you'd like to still use the legacy indexes, you can specify this using the indexType
attribute; for example, @Indexed(indexType = IndexType.SIMPLE) .
Under what labels and names are these annotated properties indexed?
By default, SDN employs a label-based type representation strategy that associates the un-
derlying node for a node entity with labels whose names are the simple version of the class
names in the entity hierarchy ( User in this case). The schema index is then created on the
property name defined against this label.
IfyouwantedtowritesomeCyphertoperformalookuponyour userId propertydirectly
against the graph, you'd need to issue the following query:
MATCH (n:User) WHERE n.userId = {userId} return n
Becarefulhowyounameandstructureyourdomainentities.It'sgenerallynotadvisableto
have two domain entities with the same name, even if they're in separate packages, due to
this default indexing behavior. If you had one User domain entity under a “core” package
and another under “admin”, they'd end up sharing the same label, which is probably not
what you'd want. It's possible to override this default behavior by setting an @Alias an-
notation against the class, which will then create the index against the specified alias name
instead. Nevertheless, it could be confusing to those who may not be aware of this behavi-
or, and it could result in unforeseen results if you're not careful.
Relationships to other node entities
There are also relationships between node entities. You'll be pleased to learn that these are
simply mapped as reference fields on the entity; this will be covered in section 9.2.5 .
Before we get into the details of how this is done, you need to learn about relationship en-
tities.
Search WWH ::




Custom Search