diff --git a/README.textile b/README.textile index 5fae5730f..1ed0d4cf0 100644 --- a/README.textile +++ b/README.textile @@ -2,7 +2,34 @@ h1. Spring Data Graph - Quick start The primary goal of the "Spring Data":http://www.springsource.org/spring-data project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services. As the name implies, the **Graph** project provides integration with graph value stores. The only supported Graph Database now is "Neo4j":http://neo4j.org/. -The Spring Data Graph project provides a simplified POJO based programming model that reduces that amount of boilerplate code needed to create neo4j applications. it also provides a 'cross store' persistence solution that can extend existing JPA data models with new parts (properties, entities, relationships) that are stored exclusively in the graph while being transparently integrated with the JPA entities. This enables for easy and seamless addition of new features that were not available before to JPA-based applications. +The Spring Data Graph project provides a simplified POJO based programming model that reduces that amount of boilerplate code needed to create neo4j applications. It also provides a cross-store persistence solution that can extend existing JPA data models with new parts (properties, entities, relationships) that are stored exclusively in the graph while being transparently integrated with the JPA entities. This enables for easy and seamless addition of new features that were not available before to JPA-based applications. + +
+@NodeEntity
+class Person {
+    @Indexed
+    private String name;
+
+    @RelatedTo(direction = Direction.BOTH, elementClass = Person.class)
+    private Set friends;
+
+    public Person() {}
+    public Person(String name) { this.name = name; }
+
+    private void knows(Person friend) { friends.add(friend); }
+}
+
+Person jon = new Person("Jon").persist();
+Person emil = new Person("Emil").persist();
+Person rod = new Person("Rod").persist();
+
+emil.knows(jon);
+emil.knows(rod);
+
+for(Person friend : emil.getFriends()) {
+    System.out.println("Friend: " + friend);
+}
+
h2. Maven configuration