Database Reference
In-Depth Information
9.2.4. Modeling relationship entities
A relationship entity is the relationship version of a node entity. It refers to a Java class
that's ultimately represented and backed by a Neo4j relationship in the underlying graph
database. Neo4j treats relationships as first-class citizens, which, just like nodes, can have
their own identifiers and sets of properties if required. Thus, SDN also allows them to be
represented as entities in their own right. Figure 9.4 highlights these relationships within
the domain model.
Figure 9.4. A social network model with highlighted relationships that could potentially be modeled as relationship
entities
In this section we'll cover what's required to model the physical Neo4j relationship entity
as a POJO itself; in section 9.2.5 , we'll show what's required from the node entity's per-
spective to refer to other node entities through these modeled relationships, as well as
through simpler mechanisms.
Note
You will probably define many relationships within your physical Neo4j model, but this
doesn't automatically mean that all of them need to be modeled as relationship entities in
SDN.
SDN relationship entities are generally only required for relationships that have their own
set of properties, and, together with these properties, provide context to the relationship.
 
 
Search WWH ::




Custom Search