Database Reference
In-Depth Information
Figure 3.7. Graph with only node entities
You can write Java code that creates the graph in figure 3.7 . The first two listings ( 3.1 and
3.2 ) create a single user node, using both the Java 6 (Neo4j 1.9.X) and Java 7 (Neo4j
2.0.X) idiomatic styles.
Themaindifferencebetweenthetwoisinthehandlingoftransactions.TheAPIsthatcreate
the node itself are identical, but as this is the first code we're presenting, we wanted to
give you an initial taste of both versions upfront. Moving forward, this chapter and the re-
mainder of the topic will be using the Java 7 style of transaction management unless other-
wise stated.
Listing 3.1. Creating a single user node in Neo4j (Java 6/Neo4j 1.9.X style)
 
 
Search WWH ::




Custom Search