diff --git a/src/docbkx/reference/aspectj-details.xml b/src/docbkx/reference/aspectj-details.xml index b0b4325d8..618ca1428 100644 --- a/src/docbkx/reference/aspectj-details.xml +++ b/src/docbkx/reference/aspectj-details.xml @@ -1,6 +1,6 @@ - + AspectJ details The advanced mapping mode of Spring Data Neo4j relies heavily on AspectJ. AspectJ is a Java implementation @@ -29,7 +29,7 @@ Spring Data Neo4j uses a mix of these mechanisms internally. First, when encountering the @NodeEntity or @RelationshipEntity annotations it introduces a new interface NodeBacked or RelationshipBacked to the annotated class. Secondly, it introduces - fields and methods to the annotated class. See + fields and methods to the annotated class. See for more information on the methods introduced. diff --git a/src/docbkx/reference/cross-store.xml b/src/docbkx/reference/cross-store.xml index f75133acc..d182f2183 100644 --- a/src/docbkx/reference/cross-store.xml +++ b/src/docbkx/reference/cross-store.xml @@ -1,6 +1,6 @@ - + Cross-store persistence The Spring Data Neo4j project support cross-store persistence for the advanced mapping mode, diff --git a/src/docbkx/reference/heroku.xml b/src/docbkx/reference/heroku.xml index 48c4baf8c..54d1d475a 100644 --- a/src/docbkx/reference/heroku.xml +++ b/src/docbkx/reference/heroku.xml @@ -1,6 +1,6 @@ - + Heroku: Seeding the Cloud Deploying your application into the cloud is a great way to scale from from "wouldn't it be cool if.." to diff --git a/src/docbkx/reference/neo4j-server.xml b/src/docbkx/reference/neo4j-server.xml index 6c3a0d93f..7e98fcce0 100644 --- a/src/docbkx/reference/neo4j-server.xml +++ b/src/docbkx/reference/neo4j-server.xml @@ -1,6 +1,6 @@ - + Neo4j Server Neo4j is not only available in embedded mode. It can also be installed and run as a stand-alone server diff --git a/src/docbkx/reference/performance.xml b/src/docbkx/reference/performance.xml index 501f53786..c86c5de4b 100644 --- a/src/docbkx/reference/performance.xml +++ b/src/docbkx/reference/performance.xml @@ -1,6 +1,6 @@ - + Performance considerations Although adding layers of abstraction is a common pattern in software development, each of these layers diff --git a/src/docbkx/reference/preface.xml b/src/docbkx/reference/preface.xml index 1753565b1..b2359ec79 100644 --- a/src/docbkx/reference/preface.xml +++ b/src/docbkx/reference/preface.xml @@ -1,7 +1,7 @@ - + Reference Documentation
Spring Data and Spring Data Neo4j @@ -40,13 +40,13 @@ The explanation of Spring Data Neo4j's programming model starts with some underlying details. The basic internal workings of the two mapping modes are explained in the initial chapter. - covers the simple mapping and - contains details about the advanced mapping. + covers the simple mapping and + contains details about the advanced mapping. It also explains some of the common issues around AspectJ tooling with the current IDEs. To get started with a simple application, you need only your domain model and the annotations - (see ) provided by the library. You use annotations to + (see ) provided by the library. You use annotations to mark domain objects to be reflected by nodes and relationships of the graph database. For individual fields the annotations allow you to declare how they should be processed and mapped to the graph. For property fields and references to other entities this is straightforward. @@ -57,17 +57,17 @@ Relationships between entities are first class citizens in a graph database and therefore worth a separate - chapter () describing their usage in Spring Data Neo4j. + chapter () describing their usage in Spring Data Neo4j. Indexing operations are useful for finding individual nodes and relationships in a graph. They can be used to start graph operations or to be processed in your application. Indexing in the plain Neo4j API is a bit more involved. Spring Data Neo4j maintains automatic indexes per entity class, with @Indexed annotations on relevant fields. - () + () Being a Spring Data library, Spring Data Neo4j offers a comprehensive Neo4j-Template - () for interacting with + () for interacting with the mapped entities and the Neo4j graph database. The operations provided by Spring Data Neo4j - Repositories per mapped entity class are based on the API offered by the Neo4j-Template. It also provides the operations of the Neo4j Core API in a more convenient way. Especially the querying (Indexes, Cypher, Gremlin and Traversals) and result conversion @@ -80,35 +80,35 @@ each repository. The implementation details of commonly used persistence methods are handled by the library. At least for typical CRUD, index- and query-operations that is very convenient. The repositories are extensible by annotated, named or derived finder methods. - For custom implementations of repository methods you are free to add your own code. (). + For custom implementations of repository methods you are free to add your own code. (). To be able to leverage the schema-free nature of Neo4j it is possible to project any entity to any other entity type. That is useful as long as they share some properties (or relationships). The entities don't have to share any super-types - or hierarchies. How that works is explained here: . + or hierarchies. How that works is explained here: . Spring Data Neo4j also allows you to integrate with the powerful geospatial graph library Neo4j-Spatial that offers full support for working with any kind of geo-data. Spring Data Neo4j repositories expose a couple of those operations - via bounding-box and near-location searches. . + via bounding-box and near-location searches. . Using computed fields that are dynamically backed by graph operations is a bit more involved. First you should know about traversals, Cypher queries and Gremlin expressions. Those are explained in . Then you can start using virtual, computed fields - in your entities . + in your entities . If you like the ActiveRecord approach that uses persistence methods mixed into the domain classes, you will want to look at the description of the additional - entity methods (see ) that are added to your + entity methods (see ) that are added to your domain objects by Spring Data Neo4j Aspects. Those allow you to manage the entity lifecycle as well as to connect entities. Those methods also provide the means to execute the mentioned graph operations with your entity as a starting point. Neo4j is a fully ACID, enterprise grade database. It uses Java transactions, and internally a 2-phase commit protocol, to guarantee the - safety of your data. The implications of that are described in the chapter around transactions. () + safety of your data. The implications of that are described in the chapter around transactions. () The need of an active transaction for mutating the state of nodes or relationships implies that direct changes to @@ -116,7 +116,7 @@ want to care about transactions and the open-session-in-view pattern is not widely used. Therefore Spring Data Neo4j's advanced mappings introduced an entity lifecyle and added support for detached entities which can be used for temporary domain objects that are not intended to be stored in the graph or which will be attached to the graph only later. - () + () For the simple mapping this is not neccessary as domain objects are detached by default and have to be explicitly @@ -126,12 +126,12 @@ Unlike Neo4j which is a schema free database, Spring Data Neo4j works on Java domain objects. So it needs to store the type information in the graph to be able to reconstruct the entities when just nodes are retrieved. To achieve that it employs type-representation-strategies which are described in a separate chapter. - (see ) + (see ) Spring Data Neo4j offers basic support for bean property validation (JSR-303). Annotations from that JSR are recognized and evaluated whenever a property is set, or when a previously detached entity is persisted to the graph. - (see ) + (see ) Unfortunately the setup of Spring Data Neo4j advanced mapping mode is more involved than we'd like. That is partly due to the Maven setup @@ -139,23 +139,23 @@ itself boils down to two lines of <spring-neo4j> namespace setup. (see ) - In a polyglot persistence context Spring Data Neo4j can also be used in a JPA environment to add graph features to your JPA entities. In the + In a polyglot persistence context Spring Data Neo4j can also be used in a JPA environment to add graph features to your JPA entities. In the the slightly different behavior and setup of a Graph-JPA interaction are described. The provided samples, which are also publicly hosted on Github, are explained in - . + . - The performance implications of using Spring Data Neo4j are detailed in . + The performance implications of using Spring Data Neo4j are detailed in . This chapter also discusses which use cases should not be handled with Spring Data Neo4j. As AspectJ might not be well known to everyone, some of the core concepts of the aspect oriented, - advanced mapping mode for Java are explained in . + advanced mapping mode for Java are explained in . - How to consume the REST-API of a Neo4j-Server is the topic of . + How to consume the REST-API of a Neo4j-Server is the topic of . But Spring Data Neo4j can also be used to create custom Extensions for the Neo4j Server which would serve domain model abstractions to a suitable front-end. So instead of talking low level primitives to a database, the front-end or web-app @@ -165,7 +165,7 @@ Please be aware that the advanced mapping mode of Spring Data Neo4j is based on AspectJ and uses some - advanced features of that toolset. See the section on AspectJ () for + advanced features of that toolset. See the section on AspectJ () for details if you run into any problems. diff --git a/src/docbkx/reference/programming-model/aspectj.xml b/src/docbkx/reference/programming-model/aspectj.xml index a7c55b557..4d35727af 100644 --- a/src/docbkx/reference/programming-model/aspectj.xml +++ b/src/docbkx/reference/programming-model/aspectj.xml @@ -1,17 +1,17 @@ -
+
Advanced Mapping with AspectJ Behind the scenes, Spring Data Neo4j leverages AspectJ aspects to modify the behavior of annotated POJO entities - (see ). Each node entity is backed by a graph node that holds its + (see ). Each node entity is backed by a graph node that holds its properties and relationships to other entities. AspectJ is used for intercepting field access, so that Spring Data Neo4j can retrieve the appropriate information from the entity's backing node or relationship. The aspect introduces an internal field (entityState) and some public methods - (see ) to the entities, for instance + (see ) to the entities, for instance entity.getPersistentState() and entity.relateTo. It also introduces some methods for graph operations that start at the current entity. Introduced methods for equals() and hashCode() use the underlying node or relationship. diff --git a/src/docbkx/reference/programming-model/attachdetach.xml b/src/docbkx/reference/programming-model/attachdetach.xml index a8ea87689..1fd162cf5 100644 --- a/src/docbkx/reference/programming-model/attachdetach.xml +++ b/src/docbkx/reference/programming-model/attachdetach.xml @@ -1,6 +1,6 @@ -
+
Detached node entities in advanced mapping mode This section only applies to the advanced mapping (AspectJ-backed). The simple mapping always detaches entities on @@ -48,7 +48,7 @@ class Person { Person p = new Person("Michael").persist(); ]]> -
+
Relating detached entities As mentioned above, an entity simply created with the new keyword starts out detached. diff --git a/src/docbkx/reference/programming-model/beanvalidation.xml b/src/docbkx/reference/programming-model/beanvalidation.xml index 594895d71..8a160df16 100644 --- a/src/docbkx/reference/programming-model/beanvalidation.xml +++ b/src/docbkx/reference/programming-model/beanvalidation.xml @@ -1,6 +1,6 @@ -
+
Bean validation (JSR-303) Spring Data Neo4j supports property-based validation support. When a property is changed and persisted, it is diff --git a/src/docbkx/reference/programming-model/conversion.xml b/src/docbkx/reference/programming-model/conversion.xml index 0060fa5ff..a8be61742 100644 --- a/src/docbkx/reference/programming-model/conversion.xml +++ b/src/docbkx/reference/programming-model/conversion.xml @@ -1,6 +1,6 @@ -
+
Conversion Neo4jTemplate has a generic convert method which might also use projection underneath. @@ -14,7 +14,7 @@ It is also possible to provide a custom ResultConverter that additionally takes care of conversions. -
+
Mapping Query Results For both queries executed via the result conversion DSL as well as repository methods, it is possible to specify diff --git a/src/docbkx/reference/programming-model/indexing.xml b/src/docbkx/reference/programming-model/indexing.xml index 427d4ece7..74cfb2bab 100644 --- a/src/docbkx/reference/programming-model/indexing.xml +++ b/src/docbkx/reference/programming-model/indexing.xml @@ -1,6 +1,6 @@ -
+
Indexing @@ -43,7 +43,7 @@ The indexes can be queried by using a repository (see - ). + ). The repository is an instance of org.springframework.data.neo4j.repository.IndexRepository. The methods findByPropertyValue() and findAllByPropertyValue() work on @@ -215,7 +215,7 @@ personFulltextIndex.query("{name:*cha*}"); For querying the index, the template offers query methods that take either the exact match parameters or a query object/expression, return the results as Result objects which - can then be converted and projected further using the result-conversion-dsl (see ). + can then be converted and projected further using the result-conversion-dsl (see ).
@@ -233,7 +233,7 @@ personFulltextIndex.query("{name:*cha*}"); Spatial Indexes Spring Data Neo4j offers limited support for spatial queries using the neo4j-spatial library. See the - separate chapter for details. + separate chapter for details.
diff --git a/src/docbkx/reference/programming-model/introducedmethods.xml b/src/docbkx/reference/programming-model/introducedmethods.xml index abfdc40f5..f98d8c0d9 100644 --- a/src/docbkx/reference/programming-model/introducedmethods.xml +++ b/src/docbkx/reference/programming-model/introducedmethods.xml @@ -1,6 +1,6 @@ -
+
Active Record Methods for Advanced Mapping Mode This chapter only applies to the advanced mapping. Currently the Aspects introduce the following diff --git a/src/docbkx/reference/programming-model/mapping.xml b/src/docbkx/reference/programming-model/mapping.xml index c08e2173c..a83bfbde6 100644 --- a/src/docbkx/reference/programming-model/mapping.xml +++ b/src/docbkx/reference/programming-model/mapping.xml @@ -1,10 +1,10 @@ -
+
Object Graph Mapping - Up until recently Spring Data Neo4j supported only the more advanced and flexible AspectJ based mapping approach, see . - Feedback about issues with the AspectJ tooling and other implications persuaded us to add a simpler mapping (see ) to Spring Data Neo4j. + Up until recently Spring Data Neo4j supported only the more advanced and flexible AspectJ based mapping approach, see . + Feedback about issues with the AspectJ tooling and other implications persuaded us to add a simpler mapping (see ) to Spring Data Neo4j. Both versions work with the same annotations and provide similar API's, but differ in behaviour. @@ -30,7 +30,7 @@ Otherwise the two approaches share much of the infrastructure. E.g. for creating new entity instances from - type information store in the graph (), + type information store in the graph (), the infrastructure for mapping individual fields to graph properties and relationships and everything related to indexing and querying. A certain part of that is also exposed via the Neo4jTemplate for direct use. diff --git a/src/docbkx/reference/programming-model/node-entities.xml b/src/docbkx/reference/programming-model/node-entities.xml index 4121fa56b..1516b6f3b 100644 --- a/src/docbkx/reference/programming-model/node-entities.xml +++ b/src/docbkx/reference/programming-model/node-entities.xml @@ -1,6 +1,6 @@ -
+
Defining node entities Node entities are declared using the @NodeEntity annotation. Relationship entities use @@ -22,7 +22,7 @@ If the partial attribute is set to true, this entity takes part in a cross-store setting, where the entity lives in both the graph database and a JPA data source. See - for more information. + for more information. Entity fields can be annotated with @GraphProperty, @RelatedTo, @@ -194,8 +194,8 @@ assertThat(studio.hashCode(), is(not(equalTo(sameStudio.hashCode()))); indexing facilities. The resulting index can be used to later retrieve nodes or relationships that contain a certain property value, e.g. a name. Often an index is used to establish the start node for a traversal. Indexes are accessed by a repository for a particular node or relationship - entity type. See and - for more information. + entity type. See and + for more information.
@@ -224,7 +224,7 @@ public class Group { - Please note that this annotation can also be used on repository methods. () + Please note that this annotation can also be used on repository methods. ()
diff --git a/src/docbkx/reference/programming-model/projection.xml b/src/docbkx/reference/programming-model/projection.xml index 71545eac8..8c509b35a 100644 --- a/src/docbkx/reference/programming-model/projection.xml +++ b/src/docbkx/reference/programming-model/projection.xml @@ -1,6 +1,6 @@ -
+
Projecting entities As the underlying data model of a graph database doesn't imply and enforce strict type constraints like a diff --git a/src/docbkx/reference/programming-model/relationships.xml b/src/docbkx/reference/programming-model/relationships.xml index ea4fcfc67..ada64a1a0 100644 --- a/src/docbkx/reference/programming-model/relationships.xml +++ b/src/docbkx/reference/programming-model/relationships.xml @@ -1,6 +1,6 @@ -
+
Relating node entities Since relationships are first-class citizens in Neo4j, associations between node entities are represented @@ -14,7 +14,7 @@ As of Neo4j 1.4.M03, circular references are allowed. Spring Data Neo4j reflects this accordingly. -
+
@RelatedTo: Connecting node entities Every field of a node entity that references one or more other node entities is backed by relationships @@ -126,7 +126,7 @@ public class Actor { via relationships, but it provides no way of accessing the relationships themselves. - Relationship entities can be accessed via by @RelatedToVia-annotated () + Relationship entities can be accessed via by @RelatedToVia-annotated () fields or methods like entity.getRelationshipTo() or template|repository.getRelationship(s)Between(). @@ -134,7 +134,7 @@ public class Actor { Relationship entities either be instantiated directly and set or added to @RelatedToVia-annotated fields or created by the introduced entity.relateTo(), template|repository.createRelationshipBetween() methods - (see alos ) + (see alos ) Fields in relationship entities are, similarly to node entities, persisted as properties on @@ -169,7 +169,7 @@ public class Role {
-
+
@RelatedToVia: Accessing relationship entities To provide easy programmatic access to the richer relationship entities of the data model, @@ -210,7 +210,7 @@ public class Friendship {
-
+
Relationship Type Precedence In the example above we show how to specify a default relationship type, and how to provide the relationship type using an annotation property. Here is an example of using the @RelationshipType annotation on a member @@ -245,7 +245,7 @@ new Acquaintance(frankSinatra, carloGambino, "its_complicated") Default
-
+
Discriminating Relationships Based On End Node Type In some cases, you want to model two different aspects of a conceptual relationship using the same relationship type. Here is a canonical example: diff --git a/src/docbkx/reference/programming-model/repositories.xml b/src/docbkx/reference/programming-model/repositories.xml index 65e743ef9..80061cd45 100644 --- a/src/docbkx/reference/programming-model/repositories.xml +++ b/src/docbkx/reference/programming-model/repositories.xml @@ -1,6 +1,6 @@ -
+
CRUD with repositories The repositories provided by Spring Data Neo4j build on the composable repository infrastructure @@ -23,7 +23,7 @@ With the RelationshipOperationsRepository it is possible to access, create and delete relationships between entitites or nodes. - The SpatialRepository allows geographic searches () + The SpatialRepository allows geographic searches () GraphRepository is a convenience repository interface, combining CRUDRepository, @@ -36,7 +36,7 @@ CRUDRepository CRUDRepository delegates to the configured TypeRepresentationStrategy - (see ) + (see ) for type based queries. @@ -118,7 +118,7 @@
Query and Finder Methods -
+
Annotated queries Queries using the Cypher graph query language can be supplied with the @Query annotation. @@ -187,7 +187,7 @@ Examples of Cypher queries placed on repository methods with @Query where values are replaced with method parameters, as described - in the <xref linkend="reference:programming-model:annotatedQueries" />) section. + in the ) section. { diff --git a/src/docbkx/reference/programming-model/simple_mapping.xml b/src/docbkx/reference/programming-model/simple_mapping.xml index 9658ea7c5..1ec2eda71 100644 --- a/src/docbkx/reference/programming-model/simple_mapping.xml +++ b/src/docbkx/reference/programming-model/simple_mapping.xml @@ -1,11 +1,11 @@ -
+
Simple Object Graph Mapping In addition to the advanced object graph mapping using AspectJ, Spring Data Neo4j also supports a simpler mode that converts graph data into domain objects and vice versa. It does not require any additional set up and should - work out of the box. The simple mapping approach uses the same annotations () + work out of the box. The simple mapping approach uses the same annotations () as the advanced mapping to declare mapping meta-information. diff --git a/src/docbkx/reference/programming-model/spatial.xml b/src/docbkx/reference/programming-model/spatial.xml index 1766fe28b..46c7907b6 100644 --- a/src/docbkx/reference/programming-model/spatial.xml +++ b/src/docbkx/reference/programming-model/spatial.xml @@ -1,6 +1,6 @@ -
+
Geospatial Queries SpatialRepository is a dedicated Repository for spatial queries. diff --git a/src/docbkx/reference/programming-model/template.xml b/src/docbkx/reference/programming-model/template.xml index 31af816d5..48f16afda 100644 --- a/src/docbkx/reference/programming-model/template.xml +++ b/src/docbkx/reference/programming-model/template.xml @@ -1,6 +1,6 @@ -
+
Neo4jTemplate @@ -8,7 +8,7 @@ The Neo4jTemplate offers the convenient API of Spring templates for the Neo4j graph database. The Spring Data Neo4j Object Graph mapping builds upon the core functionality of the template to persist objects to the graph and load them in a variety of ways. - The template handles the active mapping mode () transparently. + The template handles the active mapping mode () transparently. Besides methods for creating, storing and deleting entities, nodes and relationships in the graph, Neo4jTemplate diff --git a/src/docbkx/reference/programming-model/transactions.xml b/src/docbkx/reference/programming-model/transactions.xml index 53a4bb98f..e18aaa2dd 100644 --- a/src/docbkx/reference/programming-model/transactions.xml +++ b/src/docbkx/reference/programming-model/transactions.xml @@ -1,6 +1,6 @@ -
+
Transactions Neo4j is a transactional database, only allowing modifications to be performed within transaction diff --git a/src/docbkx/reference/programming-model/typerepresentationstrategy.xml b/src/docbkx/reference/programming-model/typerepresentationstrategy.xml index af10717e5..3fb13ff7d 100644 --- a/src/docbkx/reference/programming-model/typerepresentationstrategy.xml +++ b/src/docbkx/reference/programming-model/typerepresentationstrategy.xml @@ -1,6 +1,6 @@ -
+
Entity type representation There are several ways to represent the Java type hierarchy of the data model in the graph. In general, for all diff --git a/src/docbkx/reference/samples.xml b/src/docbkx/reference/samples.xml index 07489a7f2..c5622a65a 100644 --- a/src/docbkx/reference/samples.xml +++ b/src/docbkx/reference/samples.xml @@ -1,10 +1,10 @@ - + Sample code -
+
Introduction Spring Data Neo4j comes with a number of sample applications. The source code of the samples can be found on @@ -13,7 +13,7 @@
-
+
Hello Worlds sample application The Hello Worlds sample application is a simple console application. It creates some worlds @@ -38,7 +38,7 @@
-
+
IMDB sample application The IMDB sample is a web application that imports datasets from the Internet Movie Database (IMDB) @@ -65,7 +65,7 @@
-
+
MyRestaurants sample application Simple, JPA-based web application for managing users and restaurants, with the ability to add @@ -80,7 +80,7 @@
-
+
MyRestaurant-Social sample application This application extends the MyRestaurants sample application, adding social networking @@ -102,7 +102,7 @@
-
+
Cineasts social movie database The cineasts.net application was introduced extensively in the first part of this guide, the diff --git a/src/docbkx/tutorial/spring-data-neo4j-aj.xml b/src/docbkx/tutorial/spring-data-neo4j-aj.xml index d1009f8e5..78abaa7fa 100644 --- a/src/docbkx/tutorial/spring-data-neo4j-aj.xml +++ b/src/docbkx/tutorial/spring-data-neo4j-aj.xml @@ -9,7 +9,7 @@ classes clean. Spring Data Neo4j promised to do the heavy lifting for us, so we continued investigating it. - One of the more advanced mapping modes of Spring Data Neo4j depends heavily on AspectJ, see . + One of the more advanced mapping modes of Spring Data Neo4j depends heavily on AspectJ, see . Via the SpringFramework we were already used to Aspects doing the work behind the scenes in lots of places, so we were not afraid. Some parts of our classes would get a bit of new behavior, but it would not be visible in our code. diff --git a/src/docbkx/tutorial/spring-data-neo4j.xml b/src/docbkx/tutorial/spring-data-neo4j.xml index 5896f8593..9be170d36 100644 --- a/src/docbkx/tutorial/spring-data-neo4j.xml +++ b/src/docbkx/tutorial/spring-data-neo4j.xml @@ -10,7 +10,7 @@ Spring Data Neo4j comes with two mapping modes. The more powerful one depends heavily on AspectJ, - see , so we ignored it for the time being. The simple direct + see , so we ignored it for the time being. The simple direct POJO-mapping copies the data out of the graph and into our entities. Good enough for a web-application like ours.