From 0673c0d054d30e91eec0e79e8972f36909a1ef12 Mon Sep 17 00:00:00 2001 From: Thomas Risberg Date: Mon, 14 Feb 2011 22:33:57 -0500 Subject: [PATCH 1/2] release type should default to snapshot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be1a0c496..6b5f694e6 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ Spring Data Graph DATAGRAPH ${project.version} - milestone + snapshot ${dist.id}-${dist.version} ${dist.finalName}.zip target/${dist.fileName} From 52426a7f6ee6b12c598e7b1effe978378580bcfa Mon Sep 17 00:00:00 2001 From: Anders Nawroth Date: Tue, 15 Feb 2011 17:48:07 +0100 Subject: [PATCH 2/2] Some attention to detail. --- src/docbkx/cross-store.xml | 21 ++-- src/docbkx/introduction/get-started.xml | 11 +-- src/docbkx/neo4j.xml | 14 +-- src/docbkx/preface.xml | 2 +- src/docbkx/programming-model.xml | 37 +++---- src/docbkx/setup.xml | 126 ++++++++++++------------ 6 files changed, 108 insertions(+), 103 deletions(-) diff --git a/src/docbkx/cross-store.xml b/src/docbkx/cross-store.xml index e03b23e77..31b7077d6 100644 --- a/src/docbkx/cross-store.xml +++ b/src/docbkx/cross-store.xml @@ -3,7 +3,7 @@ Cross-store persistence with a graph database The Spring Data Graph project support cross-store persistence which allows parts of the data mode to be stored in a traditional - JPA datastore (RDBMS) and other parts of the data model (even partial entites, i.e. some properties or relationships) in the graph + JPA datastore (RDBMS) and other parts of the data model (even partial entites, that is some properties or relationships) in a graph store. @@ -40,7 +40,7 @@ @NodeEntity(partial = "true") When annotating an entity with partial true, DATAGRAPH assumes that this is a cross-store entity. So it is only responsible for the fields - annotated with SDGRPAH annotations. JPA should not take care of those fields (they should be annotated with @Transient). In this mode of + annotated with DATAGRAPH annotations. JPA should not take care of these fields (they should be annotated with @Transient). In this mode of operation DATAGRAPH also handles the cross-store connection via the content of the JPA id field. @@ -48,7 +48,7 @@ @GraphProperty For common fields containing primitive or convertible values that wouldn't have to be annotated in exclusive DATAGRAPH operations this - explicit declaration is necessary to be sure that they are intended to be stored in the graph. Those fields should then be made transient + explicit declaration is necessary to be sure that they are intended to be stored in the graph. These fields should then be made transient so that JPA doesn't try to take care of them as well. @@ -120,16 +120,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:datagraph="http://www.springframework.org/schema/data/graph" xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd - http://www.springframework.org/schema/data/graph http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.0.xsd + http://www.springframework.org/schema/data/graph + http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd "> - + - + diff --git a/src/docbkx/introduction/get-started.xml b/src/docbkx/introduction/get-started.xml index 35dea1380..c21a0c875 100644 --- a/src/docbkx/introduction/get-started.xml +++ b/src/docbkx/introduction/get-started.xml @@ -20,7 +20,6 @@ As explained in , Spring Data Graph (DATAGRAPH) provides integration between the Spring framework and graph databases. Familiarity with the Spring framework is assumed as stated in , and only minimally cross-referenced here. Graph databases and Neo4j in particular are explained in a bit more detail. - minimally cross-referenced here. Graph databases and Neo4j in particular are explained in a bit more detail. The main focus of this document is however on explaining the steps needed to get a DATAGRAPH-backed application up and running. @@ -30,7 +29,7 @@ such as the IoC container, converter API and the AOP infrastructure. While it is less important - to know the Spring APIs, understanding the concepts behind them is. + to know the Spring APIs, understanding the concepts behind them is essential. The Spring Framework documentation home page is a good starting point for developers wanting become more familiar with Spring Framework. @@ -69,11 +68,11 @@ IMDB sample - A web application that imports datasets from the Internet Movie Database (IMDB) into the graph database. It allows listings of movies with their actors and actors with their roles in different movies. It also uses graph traversal operations to calculate the Kevin Bacon number (distance to a actor that has acted with Kevin Bacon). This sample application shows the basic usage of DATAGRAPH in a more complex setting with several annotated entities and relationships as well as usage of indices and graph traversal. + A web application that imports datasets from the Internet Movie Database (IMDB) into the graph database. It allows listings of movies with their actors and actors with their roles in different movies. It also uses graph traversal operations to calculate the Kevin Bacon number (distance to an actor that has acted with Kevin Bacon). This sample application shows the basic usage of DATAGRAPH in a more complex setting with several annotated entities and relationships as well as usage of indices and graph traversal. MyRestaurant sample - Simple webapp for managing users and restaurants, with the ability to add a restaurants as favorites to a user. + Simple webapp for managing users and restaurants, with the ability to add restaurants as favorites to a user. MyRestaurant-Social sample @@ -103,7 +102,7 @@
- Following Development + Follow the Development For information on the Spring Data source code repository, nightly builds and snapshot artifacts please see the Spring Data home page. @@ -118,4 +117,4 @@ (@SpringData)
-
\ No newline at end of file + diff --git a/src/docbkx/neo4j.xml b/src/docbkx/neo4j.xml index 5db494e65..624f737ff 100644 --- a/src/docbkx/neo4j.xml +++ b/src/docbkx/neo4j.xml @@ -8,7 +8,7 @@ Neo4j has been in commercial development for 10 years and in production for over 7 years. It is a mature and robust graph database that provides: - an intuitive graph-oriented model for data representation. Instead of static and rigid tables, rows and columns, you work with a flexible graph network consisting of nodes, relationships and properties. + an intuitive graph-oriented model for data representation. Instead of static and rigid tables, rows and columns, you work with a flexible graph network consisting of nodes, relationships and properties. a disk-based, native storage manager completely optimized for storing graph structures for maximum performance and scalability. massive scalability. Neo4j can handle graphs of several billion nodes/relationships/properties on a single machine and can be sharded to scale out across multiple machines. a powerful traversal framework for high-speed traversals in the node space. @@ -30,11 +30,11 @@ The EmbeddedGraphDatabaseService is running within the current Java application for highest performance and tightest integration. There are other, - remote implementations that provide access to Neo4j stores via REST or RMI. + remote implementations that provide access to Neo4j stores via REST.
Creating Nodes and Relationships - Using the API of GraphDatabaseService it is easy to create nodes and relate them to each other. Relationships are named. Both nodes and relationships can have properties. Property values can be of primitive Java types and Strings as well as byte arrays for binary data. + Using the API of GraphDatabaseService it is easy to create nodes and relate them to each other. Relationships are named. Both nodes and relationships can have properties. Property values can be of primitive Java types and Strings as well as byte arrays for binary data or arrays of other Java primitives or Strings. Node creation and modification has to happen within a transaction, while reading from the graph store can be done without a transaction. - Currently indexing is a manual process; auto-indexes are a future - feature. (DATAGRAPH already provides auto-indexing via the - @Indexed annotation.) + DATAGRAPH provides auto-indexing via the + @Indexed annotation, while this still is a + manual process when using the Neo4j API.
diff --git a/src/docbkx/preface.xml b/src/docbkx/preface.xml index e035aaf93..4e9617a45 100644 --- a/src/docbkx/preface.xml +++ b/src/docbkx/preface.xml @@ -12,6 +12,6 @@ For the developer of a DATAGRAPH backed application only the public annotations are relevant, basic knowledge of graph stores is needed - to access advanced functionality like traversals. Traversals results can also be mapped to fields of entities. + to access advanced functionality like traversals. Traversal results can also be mapped to fields of entities. diff --git a/src/docbkx/programming-model.xml b/src/docbkx/programming-model.xml index 0b35e281b..e32dd16ef 100644 --- a/src/docbkx/programming-model.xml +++ b/src/docbkx/programming-model.xml @@ -59,6 +59,7 @@ public class Role { private Actor actor; @EndNode private Movie movie; +} ]]>
@@ -71,10 +72,10 @@ public class Role { Fields with @RelatedTo pointing to other NodeEntities Relationships to other NodeEntities are mapped to graph relationships. Those can either be single - relationships (1:1) or multiple relationships (1:n). In most cases the simple relationships to other + relationships (1:1) or multiple relationships (1:n). In most cases single relationships to other node entities don't have to be annotated as DATAGRAPH can extract all needed information from the field using reflection. In the case of - multi-relationships, the elementClass parameter of @RelatedTo must be specified because of type erasure. + multiple relationships, the elementClass parameter of @RelatedTo must be specified because of type erasure. The direction (default OUTGOING) and type (inferred from field name) parameters of the annotation are optional. @@ -126,17 +127,17 @@ public class Actor { IndexManager, triggered by value modification. The resulting index can be used to later retrieve nodes or relationships that contain a certain property - value (e.g. a name), - often to establish the start node for a traversal. + value (for example a name). Often an index is used to establish the start node for a traversal. Indexes are accessed by a Finder for a particular NodeEntity or RelationshipEntity, created via a FinderFactory. - + + GraphDatabaseContext exposes the indexes for Nodes and Relationships. Indexes can be named, for instance to keep separate domain concepts in separate indexes. That's why it is possible to specifiy an index name with the @Indexed annotation. It can also be specified at the entity level, this name is then the default index name for - all fields of the entity. If no index name is specified, it defaults to the one configured with neo4j + all fields of the entity. If no index name is specified, it defaults to the one configured with Neo4j ("node" and "relationship").
@@ -159,14 +160,14 @@ public class Actor { Finding Nodes with Finders Spring Data Graph also comes with a type bound Repository-like Finder implementation that provides methods for locating nodes - and relationships. + and relationships: using direct access findById(id) , - iterating over all nodes of a node entity type (findAll), + iterating over all nodes of a node entity type (findAll), counting the instances of a node entity type (count), iterating over all indexed instances with a certain property value (findAllByPropertyValue), - getting a single instances with a certain property value (findByPropertyValue), - iterating over a traversal result (findAllByTraversal), + getting a single instance with a certain property value (findByPropertyValue), + iterating over a traversal result (findAllByTraversal). The Finder instances are created via a FinderFactory to be bound to a concrete node or relationship entity class. @@ -199,7 +200,7 @@ Iterable davesFriends = finder.findAllByTraversal(dave, An alternative approach could use indexing operations to perform the same functionality. Or one could skip the NodeTypeStrategy altogether if no - strict checks on type conformity are needed that would allow for a much more flexible data model. + strict checks on type conformity are needed, which would allow for a much more flexible data model.
@@ -212,9 +213,9 @@ Iterable davesFriends = finder.findAllByTraversal(dave, DATAGRAPH is designed to work within transaction boundaries. So entity creation and modification should happen within transactional methods. - Due to the usage of POJO entities it is common to create and populate them also outside of a transaction (e.g. in the web layer). That's why + Due to the usage of POJO entities it is common to create and populate them also outside of a transaction (for example in the web layer). That's why some housekeeping support was added to DATAGRAPH. It is possible to create node entities outside of transactions and also to modify their fields. - Those values are then not stored within the backing node but instead only in the entity itself. When the entity reenters a transactional context + The values are then not stored within the backing node but instead only in the entity itself. When the entity reenters a transactional context and its fields are read or written to, all the pending changes are flushed to the backing node first. At the moment there is no support for the creation of relationships outside of transactions and also more complex operations like creating whole @@ -225,7 +226,7 @@ Iterable davesFriends = finder.findAllByTraversal(dave, Methods added to Entity Classes The node and relationship aspects introduce (via ITD - inter type declaration) several methods to the entities that - make common tasks easier. Unfortunately those methods are not generified yet, so the + make common tasks easier. Unfortunately these methods are not generified yet, so the results have to be casted to the correct return type. @@ -241,7 +242,7 @@ Iterable davesFriends = finder.findAllByTraversal(dave, - equals and hashcode delegated to the underlying state + equals and hashcode are delegated to the underlying state entity.equals() and entity.hashCode() @@ -249,7 +250,7 @@ Iterable davesFriends = finder.findAllByTraversal(dave, creating relationships to a target node entity - nodeEntity.relateTo(targetEntity, relationshipClass, relationshipTyperelationshipType) + nodeEntity.relateTo(targetEntity, relationshipClass, relationshipType) @@ -261,7 +262,7 @@ Iterable davesFriends = finder.findAllByTraversal(dave, removing a single relationship - nodeEntity.removeRelationshipTo(targetEntity, relationshipTyp) + nodeEntity.removeRelationshipTo(targetEntity, relationshipType) @@ -294,7 +295,7 @@ Iterable davesFriends = finder.findAllByTraversal(dave, For instance an order can be used in these contexts: customer, procurement, logistics, billing, fulfillment and many more. - Each of those contexts requires its distinct set of attributes and operations. As Java doesn't support Mixins one would put + Each of those contexts requires its distinct set of attributes and operations. As Java doesn't support mixins one would put the sum of all of those into the entity class and thereby making it very big, brittle and hard to understand. Being able to take a basic order and project it to a different (not related in the inheritance hierarchy or even an interface) order type that is valid in the current context and only offers the attributes and methods needed here would be very benefitial. diff --git a/src/docbkx/setup.xml b/src/docbkx/setup.xml index 2bc5cf4ff..f9cbc842f 100644 --- a/src/docbkx/setup.xml +++ b/src/docbkx/setup.xml @@ -3,19 +3,19 @@ Setup required for Spring Data Graph To use DATAGRAPH in your application, some setup is required. For building the application the necessary Maven dependencies must be included and - for the aspectj weaving some extensions of the compile goal are necessary. This chapter also discusses the Spring configuration needed to set up + for the AspectJ weaving some extensions of the compile goal are necessary. This chapter also discusses the Spring configuration needed to set up DATAGRAPH. Examples for this setup can be found in the DATAGRAPH examples.
Maven Configuration - As stated in the requirements chapter, DATAGRAPH projects are easiest to build with Apache Maven. The main dependencies are DATAGRAPH itself, Spring Data Commons, some parts of the Spring-Framework and of course the Neo4j graph database. + As stated in the requirements chapter, DATAGRAPH projects are easiest to build with Apache Maven. The main dependencies are DATAGRAPH itself, Spring Data Commons, some parts of the Spring Framework and of course the Neo4j graph database.
Repositories The milestone releases of DATAGRAPH are available from the dedicated milestone repository. Neo4j - releases are available from Maven Central, while snapshots are available from the Neo4j repository. + releases and milestones are available from Maven Central. @@ -23,12 +23,6 @@ Springframework Maven Repository http://maven.springframework.org/milestone - - - neo4j-public-repository - Publically available Maven 2 repository for Neo4j - http://m2.neo4j.org - ]]>
@@ -46,9 +40,9 @@ - org.aspectj - aspectjrt - 1.6.10.RELEASE + org.aspectj + aspectjrt + 1.6.10.RELEASE ]]> @@ -56,48 +50,48 @@
AspectJ build configuration - As DATAGRAPH uses uses AspectJ for built time aspect weaving of your entities, it is necessary to add the aspectj-plugin to the build phases. The plugin has its own dependencies. You also need to explicitely specifiy libraries containing aspects (spring-aspects and spring-data-neo4j) + As DATAGRAPH uses AspectJ for build time aspect weaving of your entities, it is necessary to add the aspectj-plugin to the build phases. The plugin has its own dependencies. You also need to explicitely specifiy libraries containing aspects (spring-aspects and spring-data-neo4j) - org.codehaus.mojo - aspectj-maven-plugin - 1.0 - - - - org.aspectj - aspectjrt - 1.6.10.RELEASE - - - org.aspectj - aspectjtools - 1.6.10.RELEASE - - - - - - compile - test-compile - - - - - true - - - org.springframework - spring-aspects - - - org.springframework.data - spring-datastore-neo4j - - - 1.6 - 1.6 - + org.codehaus.mojo + aspectj-maven-plugin + 1.0 + + + + org.aspectj + aspectjrt + 1.6.10.RELEASE + + + org.aspectj + aspectjtools + 1.6.10.RELEASE + + + + + + compile + test-compile + + + + + true + + + org.springframework + spring-aspects + + + org.springframework.data + spring-datastore-neo4j + + + 1.6 + 1.6 + ]]>
@@ -142,14 +136,17 @@ + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.0.xsd + http://www.springframework.org/schema/data/graph + http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd + "> @@ -159,7 +156,8 @@ - + @@ -167,11 +165,13 @@ ]]> + - + - +