diff --git a/build/gradle/springdatagraph.gradle b/build/gradle/springdataneo4j.gradle similarity index 100% rename from build/gradle/springdatagraph.gradle rename to build/gradle/springdataneo4j.gradle diff --git a/build/ivy/build.xml b/build/ivy/build.xml index c091bd712..60a0d7f3d 100644 --- a/build/ivy/build.xml +++ b/build/ivy/build.xml @@ -1,4 +1,4 @@ - + diff --git a/pom.xml b/pom.xml index db5109bb9..fbd377900 100644 --- a/pom.xml +++ b/pom.xml @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.springframework.data - spring-data-graph-dist - Spring Data Graph Distribution - spring-data-neo4j-dist + Spring Data Neo4j Distribution + 1.2.0.BUILD-SNAPSHOT pom - spring-data-graph-parent + spring-data-neo4j-parent spring-data-neo4j spring-data-neo4j-rest @@ -20,9 +20,9 @@ http://www.springsource.com - http://github.com/SpringSource/spring-data-graph - scm:git:git://github.com/SpringSource/spring-data-graph.git - scm:git:git://github.com/SpringSource/spring-data-graph.git + http://github.com/SpringSource/spring-data-neo4j + scm:git:git://github.com/SpringSource/spring-data-neo4j.git + scm:git:git://github.com/SpringSource/spring-data-neo4j.git JIRA @@ -151,15 +151,15 @@ spring-site-staging - file:///${java.io.tmpdir}/spring-data/data-graph/docs/${project.version} + file:///${java.io.tmpdir}/spring-data/data-neo4j/docs/${project.version} spring-milestone-staging - file:///${java.io.tmpdir}/spring-data/data-graph/milestone + file:///${java.io.tmpdir}/spring-data/data-neo4j/milestone spring-snapshot-staging - file:///${java.io.tmpdir}/spring-data/data-graph/snapshot + file:///${java.io.tmpdir}/spring-data/data-neo4j/snapshot @@ -210,7 +210,7 @@ http://www.springsource.com/spring-data static.springframework.org - scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-graph/snapshot-site/ + scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-neo4j/snapshot-site/ spring-release @@ -291,7 +291,7 @@ @@ -311,7 +311,7 @@ @@ -392,7 +392,7 @@ true true -
Spring Data Graph
+
Spring Data Neo4j
1.6 true ${project.basedir}/src/main/javadoc @@ -471,8 +471,8 @@ - + ${dist.finalName} diff --git a/spring-data-graph-parent/license-header.txt b/spring-data-neo4j-parent/license-header.txt similarity index 100% rename from spring-data-graph-parent/license-header.txt rename to spring-data-neo4j-parent/license-header.txt diff --git a/spring-data-graph-parent/pom.xml b/spring-data-neo4j-parent/pom.xml similarity index 97% rename from spring-data-graph-parent/pom.xml rename to spring-data-neo4j-parent/pom.xml index 54874efb1..058d29a38 100644 --- a/spring-data-graph-parent/pom.xml +++ b/spring-data-neo4j-parent/pom.xml @@ -3,11 +3,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.springframework.data - spring-data-graph-parent - Spring Data Graph Parent + spring-data-neo4j-parent + Spring Data Neo4j Parent 1.2.0.BUILD-SNAPSHOT pom - http://www.springsource.org/spring-data/neo4j @@ -15,9 +15,9 @@ http://www.springsource.com - http://github.com/SpringSource/spring-data-graph - scm:git:git://github.com/SpringSource/spring-data-graph.git - scm:git:git://github.com/SpringSource/spring-data-graph.git + http://github.com/SpringSource/spring-data-neo4j + scm:git:git://github.com/SpringSource/spring-data-neo4j.git + scm:git:git://github.com/SpringSource/spring-data-neo4j.git JIRA @@ -124,7 +124,7 @@ 1.8.4 1.6.1 3.0.5.RELEASE - 1.1.0.RELEASE + 1.2.0.BUILD-SNAPSHOT 1.4.1 1.6.12.M1 0.8 @@ -142,15 +142,15 @@ spring-site-staging - file:///${java.io.tmpdir}/spring-data/data-graph/docs/${project.version} + file:///${java.io.tmpdir}/spring-data/data-neo4j/docs/${project.version} spring-milestone-staging - file:///${java.io.tmpdir}/spring-data/data-graph/milestone + file:///${java.io.tmpdir}/spring-data/data-neo4j/milestone spring-snapshot-staging - file:///${java.io.tmpdir}/spring-data/data-graph/snapshot + file:///${java.io.tmpdir}/spring-data/data-neo4j/snapshot @@ -204,7 +204,7 @@ static.springframework.org - scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-graph/docs/${project.version} + scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-neo4j/docs/${project.version} @@ -571,7 +571,7 @@ true -
${basedir}/../spring-data-graph-parent/license-header.txt
+
${basedir}/../spring-data-neo4j-parent/license-header.txt
src/**/*.java src/**/*.js diff --git a/spring-data-neo4j-rest/pom.xml b/spring-data-neo4j-rest/pom.xml index b0ab8817e..a4557b570 100644 --- a/spring-data-neo4j-rest/pom.xml +++ b/spring-data-neo4j-rest/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.springframework.data - spring-data-graph-parent + spring-data-neo4j-parent 1.2.0.BUILD-SNAPSHOT - ../spring-data-graph-parent/pom.xml + ../spring-data-neo4j-parent/pom.xml spring-data-neo4j-rest jar - Spring Data Graph REST Wrapper - Spring Data Neo4j REST Wrapper + http://www.springsource.org/spring-data/neo4j diff --git a/spring-data-neo4j/pom.xml b/spring-data-neo4j/pom.xml index 12a8bc46b..6e948d246 100644 --- a/spring-data-neo4j/pom.xml +++ b/spring-data-neo4j/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.springframework.data - spring-data-graph-parent + spring-data-neo4j-parent 1.2.0.BUILD-SNAPSHOT - ../spring-data-graph-parent/pom.xml + ../spring-data-neo4j-parent/pom.xml spring-data-neo4j jar Spring Data Neo4J Core - http://www.springsource.org/spring-data/neo4j diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedTo.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedTo.java index 80f77258f..0766cb0d9 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedTo.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedTo.java @@ -16,8 +16,8 @@ package org.springframework.data.neo4j.annotation; +import org.neo4j.graphdb.Direction; import org.springframework.data.annotation.Reference; -import org.springframework.data.neo4j.core.Direction; import org.springframework.data.neo4j.core.NodeBacked; import java.lang.annotation.ElementType; diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedToVia.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedToVia.java index e95b0cd56..ba341830d 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedToVia.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/RelatedToVia.java @@ -21,8 +21,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.neo4j.graphdb.Direction; import org.springframework.data.annotation.Reference; -import org.springframework.data.neo4j.core.Direction; import org.springframework.data.neo4j.core.RelationshipBacked; /** diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/DataGraphNamespaceHandler.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/DataGraphNamespaceHandler.java index 0bc0cc69d..5f0af123b 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/DataGraphNamespaceHandler.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/DataGraphNamespaceHandler.java @@ -66,7 +66,7 @@ public class DataGraphNamespaceHandler extends NamespaceHandlerSupport { @Override public String getNamedQueriesLocation() { - return "classpath*:META-INF/graph-named-queries.properties"; + return "classpath*:META-INF/neo4j-named-queries.properties"; } @Override diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/core/Direction.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/core/Direction.java deleted file mode 100644 index 9639ca47c..000000000 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/core/Direction.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2011 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.neo4j.core; - -public enum Direction { - - OUTGOING(org.neo4j.graphdb.Direction.OUTGOING), INCOMING( - org.neo4j.graphdb.Direction.INCOMING), BOTH( - org.neo4j.graphdb.Direction.BOTH); - - private org.neo4j.graphdb.Direction neo4jDirection; - - private Direction( org.neo4j.graphdb.Direction neo4jDirection ) { - this.neo4jDirection = neo4jDirection; - } - - public org.neo4j.graphdb.Direction toNeo4jDir() { - return this.neo4jDirection; - } - -} diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/IndexingPropertyFieldAccessorListenerFactory.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/IndexingPropertyFieldAccessorListenerFactory.java index b7fe33c53..7d554a58d 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/IndexingPropertyFieldAccessorListenerFactory.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/IndexingPropertyFieldAccessorListenerFactory.java @@ -114,10 +114,8 @@ public class IndexingPropertyFieldAccessorListenerFactory typeInformation) { return new RelationshipInfo( annotation.type().isEmpty() ? field.getName() : annotation.type(), - annotation.direction().toNeo4jDir(), + annotation.direction(), typeInformation, annotation.elementClass() != NodeBacked.class ? ClassTypeInformation.from(annotation.elementClass()) : null, true); @@ -87,7 +87,7 @@ public class RelationshipInfo { public static RelationshipInfo fromField(Field field, RelatedToVia annotation, TypeInformation typeInformation) { return new RelationshipInfo( annotation.type().isEmpty() ? field.getName() : annotation.type(), - annotation.direction().toNeo4jDir(), + annotation.direction(), typeInformation, annotation.elementClass() != RelationshipBacked.class ? ClassTypeInformation.from(annotation.elementClass()) : null, false); diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/GraphRepositoryFactory.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/GraphRepositoryFactory.java index 29b68e1f6..034a8abcf 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/GraphRepositoryFactory.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/GraphRepositoryFactory.java @@ -264,8 +264,7 @@ public class GraphRepositoryFactory extends RepositoryFactorySupport { protected Object dispatchQuery(String queryString, Map params, Pageable pageable) { GraphQueryMethod queryMethod = getQueryMethod(); final Class compoundType = queryMethod.getCompoundType(); - final QueryMethod.Type queryResultType = queryMethod.getType(); - if (queryResultType== QueryMethod.Type.PAGING) { + if (queryMethod.isPageQuery()) { return queryPaged(queryString,params,pageable); } if (queryMethod.isIterableResult()) { @@ -291,8 +290,7 @@ public class GraphRepositoryFactory extends RepositoryFactorySupport { protected Object dispatchQuery(String queryString, Map params, Pageable pageable) { GraphQueryMethod queryMethod = getQueryMethod(); - final QueryMethod.Type queryResultType = queryMethod.getType(); - if (queryResultType== QueryMethod.Type.PAGING) { + if (queryMethod.isPageQuery()) { return queryPaged(queryString,params,pageable); } if (queryMethod.isIterableResult()) { diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/node/NodeEntityStateFactory.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/node/NodeEntityStateFactory.java index 9bc1b3265..54963ea87 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/node/NodeEntityStateFactory.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/node/NodeEntityStateFactory.java @@ -91,4 +91,8 @@ public class NodeEntityStateFactory { private void setUp() { this.delegatingFieldAccessorFactory = new PartialNodeEntityState.PartialNodeDelegatingFieldAccessorFactory(graphDatabaseContext); } + + public GraphDatabaseContext getGraphDatabaseContext() { + return graphDatabaseContext; + } } diff --git a/spring-data-neo4j/src/main/resources/org/springframework/data/neo4j/config/datagraph-1.0.xsd b/spring-data-neo4j/src/main/resources/org/springframework/data/neo4j/config/spring-neo4j-2.0.xsd similarity index 97% rename from spring-data-neo4j/src/main/resources/org/springframework/data/neo4j/config/datagraph-1.0.xsd rename to spring-data-neo4j/src/main/resources/org/springframework/data/neo4j/config/spring-neo4j-2.0.xsd index cdd93707b..fa9b82529 100644 --- a/spring-data-neo4j/src/main/resources/org/springframework/data/neo4j/config/datagraph-1.0.xsd +++ b/spring-data-neo4j/src/main/resources/org/springframework/data/neo4j/config/spring-neo4j-2.0.xsd @@ -5,7 +5,7 @@ xmlns:repository="http://www.springframework.org/schema/data/repository" xmlns:tool="http://www.springframework.org/schema/tool" - targetNamespace="http://www.springframework.org/schema/data/graph" + targetNamespace="http://www.springframework.org/schema/data/neo4j" elementFormDefault="qualified" attributeFormDefault="unqualified"> @@ -27,7 +27,7 @@ - + @@ -47,7 +47,7 @@ - + diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Group.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Group.java index 842bb7020..0fbbba916 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Group.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Group.java @@ -16,12 +16,12 @@ package org.springframework.data.neo4j; +import org.neo4j.graphdb.Direction; import org.neo4j.graphdb.DynamicRelationshipType; import org.neo4j.graphdb.traversal.TraversalDescription; import org.neo4j.kernel.Traversal; import org.neo4j.kernel.impl.traversal.TraversalDescriptionImpl; import org.springframework.data.neo4j.annotation.*; -import org.springframework.data.neo4j.core.Direction; import org.springframework.data.neo4j.core.FieldTraversalDescriptionBuilder; import org.springframework.data.neo4j.core.NodeBacked; import org.springframework.data.neo4j.mapping.Neo4JPersistentProperty; @@ -47,6 +47,10 @@ public class Group { @Indexed private String name; + @GraphProperty + @Indexed + private Boolean admin; + @GraphProperty private String unindexedName; @@ -149,4 +153,12 @@ public class Group { public void setIndexLevelName(String indexLevelName) { this.indexLevelName = indexLevelName; } + + public Boolean isAdmin() { + return admin; + } + + public void setAdmin(Boolean admin) { + this.admin = admin; + } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Person.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Person.java index 28b45332c..59620ee19 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Person.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/Person.java @@ -23,13 +23,13 @@ import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.Size; +import org.neo4j.graphdb.Direction; import org.springframework.data.neo4j.annotation.GraphId; import org.springframework.data.neo4j.annotation.Indexed; import org.springframework.data.neo4j.annotation.NodeEntity; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.annotation.RelatedTo; import org.springframework.data.neo4j.annotation.RelatedToVia; -import org.springframework.data.neo4j.core.Direction; import org.springframework.data.neo4j.fieldaccess.DynamicProperties; diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/MatchClauseUnitTest.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/MatchClauseUnitTest.java index ffda810ea..d09c22ce3 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/MatchClauseUnitTest.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/MatchClauseUnitTest.java @@ -24,10 +24,10 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; +import org.neo4j.graphdb.Direction; import org.springframework.data.neo4j.annotation.Indexed; import org.springframework.data.neo4j.annotation.NodeEntity; import org.springframework.data.neo4j.annotation.RelatedTo; -import org.springframework.data.neo4j.core.Direction; import org.springframework.data.neo4j.mapping.Neo4JMappingContext; import org.springframework.data.repository.query.parser.Property; diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/IndexTest.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/IndexTest.java index d7a744a2b..a075dbd9b 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/IndexTest.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/IndexTest.java @@ -349,4 +349,14 @@ public class IndexTest { relationshipIndex.add(indexedRelationship, NAME, NAME_VALUE); Assert.assertEquals("indexed relationship found", indexedRelationship, relationshipIndex.get(NAME, NAME_VALUE).next()); } + + @Test + @Transactional + public void testUpdateBooleanPropertyIsReflectedInIndex() { + Group group = new Group().persist(); + group.setAdmin(true); + assertEquals(1,IteratorUtil.asCollection(groupRepository.findAllByPropertyValue("admin",true)).size()); + group.setAdmin(false); + assertEquals(0,IteratorUtil.asCollection(groupRepository.findAllByPropertyValue("admin",true)).size()); + } } diff --git a/spring-data-neo4j/src/test/resources/META-INF/graph-named-queries.properties b/spring-data-neo4j/src/test/resources/META-INF/neo4j-named-queries.properties similarity index 100% rename from spring-data-neo4j/src/test/resources/META-INF/graph-named-queries.properties rename to spring-data-neo4j/src/test/resources/META-INF/neo4j-named-queries.properties diff --git a/src/ant/upload-dist.xml b/src/ant/upload-dist.xml index f610e7998..086615479 100644 --- a/src/ant/upload-dist.xml +++ b/src/ant/upload-dist.xml @@ -13,8 +13,8 @@ ant -f src/ant/upload-dist.xml \ -Ddist.accessKey= \ -Ddist.secretKey= \ -Ddist.bucketName=dist.springframework.org \ - -Ddist.fileName=spring-data-graph-1.0.0.???.zip \ - -Ddist.filePath=../../spring-data-graph-1.0.0.???.zip \ + -Ddist.fileName=spring-data-neo4j-1.0.0.???.zip \ + -Ddist.filePath=../../spring-data-neo4j-1.0.0.???.zip \ -Ddist.version=1.0.0.??? \ upload-dist --> diff --git a/src/docbkx/index.xml b/src/docbkx/index.xml index 68d9e7807..12e25096d 100644 --- a/src/docbkx/index.xml +++ b/src/docbkx/index.xml @@ -15,7 +15,7 @@ --> Good Relationships - The Spring Data Graph Guide Book + The Spring Data Neo4j Guide Book &version; @@ -63,7 +63,7 @@ The first part of the book provides a tutorial that walks through the creation of a complete web - application called cineasts.net, built with Spring Data Graph and Neo4j. + application called cineasts.net, built with Spring Data Neo4j. Cineasts are people who love movies, and the site is a gathering place for moviegoers. For cineasts.net we decided to add a social aspect to the rating of movies, allowing friends to share their scores and get recommendations for new friends and movies. @@ -71,7 +71,7 @@ The tutorial takes the reader through the steps necessary to create the application. It provides the configuration and code examples that are needed to understand what's - happening in Spring Data Graph. The complete source code for the app is available on + happening in Spring Data Neo4j. The complete source code for the app is available on Github. @@ -80,7 +80,7 @@ - + @@ -107,15 +107,15 @@ - This part of the Spring Data Graph Guide book provides the reference documentation. It details many + This part of the Spring Data Neo4j Guide book provides the reference documentation. It details many aspects of the tutorial and also explains concepts that were only just mentioned there. Its content covers information about the programming model, APIs, concepts, annotations and - technical details of Spring Data Graph. + technical details of Spring Data Neo4j. - Whenever you look for the means to employ the full power of the Spring Data Graph library you find your + Whenever you look for the means to employ the full power of the Spring Data Neo4j library you find your answers in the reference section. If you don't, please inform us about missing or incorrect content so that we can fix that. diff --git a/src/docbkx/introduction/about.xml b/src/docbkx/introduction/about.xml index b94656469..49eaa2434 100644 --- a/src/docbkx/introduction/about.xml +++ b/src/docbkx/introduction/about.xml @@ -4,13 +4,13 @@ About this guide book
- The Spring Data Graph Project + The Spring Data Neo4j Project - Welcome to the Spring Data Graph Guide Book. Thank you for taking the time to get an in depth look - into Spring Data Graph. + Welcome to the Spring Data Neo4j Guide Book. Thank you for taking the time to get an in depth look + into Spring Data Neo4j. This project is part of the Spring Data project, which brings the convenient programming model of the Spring Framework to modern NOSQL databases. - Spring Data Graph, as the name alludes to, aims to provide support for graph databases. It currently + Spring Data Neo4j, as the name alludes to, aims to provide support for graph databases. It currently supports Neo4j.
@@ -21,10 +21,10 @@ by our peers. - If you have any feedback on Spring Data Graph or this book, please provide it via the - SpringSource JIRA, the + If you have any feedback on Spring Data Neo4j or this book, please provide it via the + SpringSource JIRA, the SpringSource NOSQL Forum, - github comments or issues, + github comments or issues, or the Neo4j mailing list. @@ -38,7 +38,7 @@ We chose a tutorial describing the creation of a web application that allows movie enthusiasts to find their favorite movies, rate them, connect with fellow movie geeks, and enjoy social features such as - recommendations. The application is running on Neo4j using Spring Data Graph and the well-known Spring + recommendations. The application is running on Neo4j using Spring Data Neo4j and the well-known Spring Web Stack. @@ -46,7 +46,7 @@ the library. It discusses the programming model, the underlying assumptions, and internals, as well as the APIs for the object-graph mapping. The reference documentation is typically used to look up concrete bits of information, or to drill down into certain topics. For hackers wanting to really delve into Spring Data - Graph, it can of course also be read cover-to-cover. + Neo4j, it can of course also be read cover-to-cover.
Acknowledgements @@ -62,7 +62,7 @@ We also appreciate very much the foresight of Rod Johnson and Emil Eifrem to initiate the project, and now also providing great forewords. Their leadership inspired collaboration between the engineering teams at - SpringSource and Neo Technology, a tremendous help during the making of Spring Data Graph. + SpringSource and Neo Technology, a tremendous help during the making of Spring Data Neo4j.     diff --git a/src/docbkx/introduction/emil.xml b/src/docbkx/introduction/emil.xml index 138b0408b..ca86e3757 100644 --- a/src/docbkx/introduction/emil.xml +++ b/src/docbkx/introduction/emil.xml @@ -7,16 +7,16 @@ "Spring is the most popular middleware on the planet," I thought to myself as I walked up to Rod Johnson in late 2009 at the JAOO conference in Aarhus, Denmark. Rod had just given an introductory presentation about Spring Roo and when he was done I told him "Great talk. You're clearly building a stack for the future. What about support for non-relational databases?" - We started talking and quickly agreed that NOSQL will play an important role in emerging stacks. Now, a year and half later, Spring Data Graph is available in its first stable release and I'm blown away by the result. Never before in any environment, in any programming framework, in any stack, has it been so easy and intuitive to tap into the power of a graph database like Neo4j. It's a testament to the efforts by an awesome team of four hackers from Neo Technology and VMware: Michael Hunger, David Montag, Thomas Risberg and Mark Pollack. + We started talking and quickly agreed that NOSQL will play an important role in emerging stacks. Now, a year and half later, Spring Data Neo4j is available in its first stable release and I'm blown away by the result. Never before in any environment, in any programming framework, in any stack, has it been so easy and intuitive to tap into the power of a graph database like Neo4j. It's a testament to the efforts by an awesome team of four hackers from Neo Technology and VMware: Michael Hunger, David Montag, Thomas Risberg and Mark Pollack. The Spring framework revolutionized how we all wrote enterprise Java applications and today it's used by millions of enterprise developers. Graph databases also stand out in the NOSQL crowd when it comes to enterprise adoption. You can find graph databases used in areas as diverse as network management, fraud detection, cloud management, anything with social data, geo and location services, master data management, bioinformatics, configuration databases, and much more. - Spring developers deserve access to the best tools available to solve their problem. Sometimes that's a relational database accessed through JPA. But more often than not, a graph database like Neo4j is the perfect fit for your project. I hope that Spring Data Graph will give you access to the power and flexibility of graph databases while retaining the familiar productivity and convenience of the Spring framework. + Spring developers deserve access to the best tools available to solve their problem. Sometimes that's a relational database accessed through JPA. But more often than not, a graph database like Neo4j is the perfect fit for your project. I hope that Spring Data Neo4j will give you access to the power and flexibility of graph databases while retaining the familiar productivity and convenience of the Spring framework. - Enjoy the Spring Data Graph guide book and welcome to the wonderful world of graph databases! + Enjoy the Spring Data Neo4j guide book and welcome to the wonderful world of graph databases! Emil Eifrem, CEO of Neo Technology diff --git a/src/docbkx/introduction/rod.xml b/src/docbkx/introduction/rod.xml index ba0af1b08..69ee4a45b 100644 --- a/src/docbkx/introduction/rod.xml +++ b/src/docbkx/introduction/rod.xml @@ -4,7 +4,7 @@ Foreword by Rod Johnson - I’m excited about Spring Data Graph for several reasons. + I’m excited about Spring Data Neo4j for several reasons. First, this project is in a very important space. We are in an era of transition. A very few years ago, a @@ -14,31 +14,31 @@ valuable in many applications. It's a choice you should add to your toolbox. - Second, Spring Data Graph is an innovative project, which makes it easy to work with one of the most interesting + Second, Spring Data Neo4j is an innovative project, which makes it easy to work with one of the most interesting new data stores. Unfortunately, the proliferation of new data stores has not been matched by innovation in programming models to work with them. Ironically, just after modern ORM mapping made working with relational data in Java relatively easy, the data store disruption occurred, and developers were back to square one: struggling once more with clumsy, low level APIs. Working with most non-relational technologies is overly - complex and imposes too much work on developers. Spring Data Graph makes working with Neo4j amazingly easy, and + complex and imposes too much work on developers. Spring Data Neo4j makes working with Neo4j amazingly easy, and therefore has the potential to make you more successful as a developer. Its use of AspectJ to eliminate persistence code from your domain model is truly innovative, and on the cutting edge of today’s Java technologies. - Third, I'm excited about Spring Data Graph for personal reasons. I no longer get to write code as often as I + Third, I'm excited about Spring Data Neo4j for personal reasons. I no longer get to write code as often as I would like. My initial convictions that Spring and AspectJ could both make building applications with Neo4j dramatically easier and cross-store object navigation possible gave me an excuse for a much-needed coding binge - early in 2010. This led to a prototype of what became Spring Data Graph — at times written paired with Emil. I’m + early in 2010. This led to a prototype of what became Spring Data Neo4j — at times written paired with Emil. I’m sure the vast majority of my code has long since been replaced (probably for the better) by coders who aren't rusty — thanks Michael and Thomas! — but I retain my pleasant memories. - Finally, Spring Data Graph is part of the broader Spring Data project: one of the key areas in which Spring is + Finally, Spring Data Neo4j is part of the broader Spring Data project: one of the key areas in which Spring is innovating to help meet new application requirements. I encourage you to explore Spring Data, and — better still — become involved in the community and contribute. - Enjoy the Spring Data Graph book, and happy coding! + Enjoy the Spring Data Neo4j book, and happy coding! Rod Johnson, Founder, Spring and SVP, Application Platform, VMware diff --git a/src/docbkx/reference/aspectj-details.xml b/src/docbkx/reference/aspectj-details.xml index d435967b6..5338f986e 100644 --- a/src/docbkx/reference/aspectj-details.xml +++ b/src/docbkx/reference/aspectj-details.xml @@ -3,7 +3,7 @@ AspectJ details - The object graph mapper of Spring Data Graph relies heavily on AspectJ. AspectJ is a Java implementation + The object graph mapper of Spring Data Neo4j relies heavily on AspectJ. AspectJ is a Java implementation of the aspect-oriented programming paradigm that allows easy extraction and controlled application of so-called cross-cutting concerns. Cross-cutting concerns are typically repetitive tasks in a system (e.g. logging, @@ -13,7 +13,7 @@ limited, potentially adding quite a number of configuration options or parameters. - The AspectJ pointcut language can be intimidating, but a developer using Spring Data Graph will not have + The AspectJ pointcut language can be intimidating, but a developer using Spring Data Neo4j will not have to deal with that. Users don't have care about to hooking into a framework mechanism, or having to extend a framework superclass. @@ -26,14 +26,14 @@ existing classes. - Spring Data Graph uses a mix of these mechanisms internally. First, when encountering the + 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 for more information on the methods introduced. - Spring Data Graph also leverages AspectJ to intercept access to fields, delegating the calls to the graph + Spring Data Neo4j also leverages AspectJ to intercept access to fields, delegating the calls to the graph database instead. Under the hood, properties and relationships will be created. @@ -52,6 +52,6 @@ AspectJ also supports other types of weaving, e.g. load-time weaving and runtime weaving. These are - currently not supported by Spring Data Graph. + currently not supported by Spring Data Neo4j. diff --git a/src/docbkx/reference/cross-store.xml b/src/docbkx/reference/cross-store.xml index 87b5c5a69..1488ef171 100644 --- a/src/docbkx/reference/cross-store.xml +++ b/src/docbkx/reference/cross-store.xml @@ -3,7 +3,7 @@ Cross-store persistence - The Spring Data Graph project support cross-store persistence, which allows for parts of the data to be + The Spring Data Neo4j project support cross-store persistence, which allows for parts of the data to be stored in a traditional JPA data store (RDBMS), and other parts in a graph store. This means that an entity can be partially stored in e.g. MySQL, and partially stored in Neo4j. @@ -15,7 +15,7 @@
Partial entities - Partial graph persistence is achieved by restricting the Spring Data Graph aspects to manage only + Partial graph persistence is achieved by restricting the Spring Data Neo4j aspects to manage only explicitly annotated parts of the entity. Those fields will be made @Transient by the aspect so that JPA ignores them. @@ -37,8 +37,8 @@ can then be found using the indexing facilities, and the two entities can be reassociated. - Using these mechanisms and the Spring Data Graph aspects, a single POJO can contain some fields - handled by JPA and others handles by Spring Data Graph. This also includes relationship fields persisted + Using these mechanisms and the Spring Data Neo4j aspects, a single POJO can contain some fields + handled by JPA and others handles by Spring Data Neo4j. This also includes relationship fields persisted in the graph database.
@@ -52,20 +52,20 @@ @NodeEntity(partial = "true") When annotating an entity with partial = true, this marks it as a cross-store entity. - Spring Data Graph will thus only manage fields explicitly annotated with @GraphProperty. + Spring Data Neo4j will thus only manage fields explicitly annotated with @GraphProperty.
@GraphProperty Fields of primitive or convertible types do not normally have to be annotated in order to be - persisted by Spring Data Graph. In cross-store mode, Spring Data Graph only + persisted by Spring Data Neo4j. In cross-store mode, Spring Data Neo4j only persists fields explicitly annotated with @GraphProperty. JPA will ignore these fields.
The following example is taken from the - Spring Data Graph examples + Spring Data Neo4j examples myrestaurants-social project: @@ -119,28 +119,28 @@ public class UserAccount {
Configuring cross-store persistence - Configuring cross-store persistence is done similarly to the default Spring Data Graph configuration. + Configuring cross-store persistence is done similarly to the default Spring Data Neo4j configuration. All you need to do is to specify an entityManagerFactory in the XML namespace - config element, and Spring Data Graph will configure itself for cross-store use. + config element, and Spring Data Neo4j will configure itself for cross-store use. Cross-store Spring configuration - Neo4j Server Neo4j is not only available in embedded mode. It can also be installed and run as a stand-alone server - accessible via a REST API. Developers can integrate Spring Data Graph into the Neo4j server infrastructure + accessible via a REST API. Developers can integrate Spring Data Neo4j into the Neo4j server infrastructure in two ways: in an unmanaged server extension, or via the REST API.
@@ -41,7 +41,7 @@ - Running Spring Data Graph on the Neo4j Server is easy. You need to tell the server where to find the + Running Spring Data Neo4j on the Neo4j Server is easy. You need to tell the server where to find the Spring context configuration file, and which beans from it to expose: Server plugin initialization @@ -74,23 +74,23 @@ public void foo( @Context WorldRepository repo ) {
- Using Spring Data Graph as a REST client + Using Spring Data Neo4j as a REST client - Spring Data Graph can use a set of Java REST bindings which come as a drop in replacement for the + Spring Data Neo4j can use a set of Java REST bindings which come as a drop in replacement for the GraphDatabaseService API. By simply configuring the graphDatabaseService to be a RestGraphDatabase pointing to a Neo4j Server instance. The Neo4j Server REST API does not allow for transactions to span across requests, which means - that Spring Data Graph is not transactional when running with a RestGraphDatabase. + that Spring Data Neo4j is not transactional when running with a RestGraphDatabase. Please also keep in mind that performing graph operations via the REST-API is about one order of magnitude slower than location operations. Try to use the Neo4j Cypher query language, server-side traversals (RestTraversal) or Gremlin expressions whenever possible for retrieving large sets of data. - Future versions of Spring Data Graph will use the more performant batching as well as a binary protocol. + Future versions of Spring Data Neo4j will use the more performant batching as well as a binary protocol. To set up your project to use the REST bindings, add this dependency to your pom.xml: @@ -104,11 +104,11 @@ public void foo( @Context WorldRepository repo ) { ]]> - Now, you set up the normal Spring Data Graph configuration, but point the database to an URL instead + Now, you set up the normal Spring Data Neo4j configuration, but point the database to an URL instead of a local directory, like so: REST client configuration - application context - + diff --git a/src/docbkx/reference/neo4j.xml b/src/docbkx/reference/neo4j.xml index bc587b1d4..ed16d2fb0 100644 --- a/src/docbkx/reference/neo4j.xml +++ b/src/docbkx/reference/neo4j.xml @@ -129,7 +129,7 @@ for (Path position : traversalDescription.traverse(myStartNode)) { Retrieval is done with query methods on indexes, returning an IndexHits iterator. - Spring Data Graph provides automatic indexing via the @Indexed annotation, eliminating the need + Spring Data Neo4j provides automatic indexing via the @Indexed annotation, eliminating the need for manual index management. @@ -176,9 +176,9 @@ for (Node foundNode : nodeIndex.get("property","value")) { Cypher can be executed on an embedded graph db using ExecutionEngine and - CypherParser. This is encapsulated in Spring Data Graph with + CypherParser. This is encapsulated in Spring Data Neo4j with CypherQueryEngine. The Neo4j-REST-Server comes with a Cypher-Plugin that is accessible remotely and is - available in the Spring Data Graph REST-Binding. + available in the Spring Data Neo4j REST-Binding. Cypher Examples on the Cineasts.net Dataset @@ -218,9 +218,9 @@ start user=(User,login,'micha') match (user)-[:FRIEND]-(friend)-[r,:RATED]->(mov turing complete. Gremlin can be executed by including the tinkerpop and blueprints dependencies and then requesting a ScriptEngine - of type "gremlin" from the javax.Script* facilities. In Spring Data Graph this is encapsulated in + of type "gremlin" from the javax.Script* facilities. In Spring Data Neo4j this is encapsulated in GremlinQueryEngine. The Neo4j-REST-Server also comes with a Gremlin-Plugin that is accessible remotely and is - available in the Spring Data Graph REST-Binding. + available in the Spring Data Neo4j REST-Binding. Sample Gremlin Queries diff --git a/src/docbkx/reference/performance.xml b/src/docbkx/reference/performance.xml index d9bcba8db..10b2b4eaa 100644 --- a/src/docbkx/reference/performance.xml +++ b/src/docbkx/reference/performance.xml @@ -5,12 +5,12 @@ Although adding layers of abstraction is a common pattern in software development, each of these layers generally adds overhead and performance penalties. This chapter discusses the performance implications - of using Spring Data Graph instead of the Neo4j API directly. + of using Spring Data Neo4j instead of the Neo4j API directly.
- When is Spring Data Graph right + When is Spring Data Neo4j right - The focus of Spring Data Graph is to add a convenience layer on top of the Neo4j API. This enables + The focus of Spring Data Neo4j is to add a convenience layer on top of the Neo4j API. This enables developers to get up and running with a graph database very quickly, having their domain objects mapped to the graph with very little work. Building on this foundation, one can later explore other, more efficient ways to explore and process the graph - if the performance requirements demand it. @@ -24,7 +24,7 @@ frameworks and libraries that expect Java POJOs as input or create them as results. - Spring Data Graph, however, was not designed with a major focus on performance. It does add some overhead + Spring Data Neo4j, however, was not designed with a major focus on performance. It does add some overhead to pure graph operations. Something to keep in mind is that any access of properties and relationships will in general read through down to the database. To avoid multiple reads, it is sensible to store the result in a local variable in suitable scope (e.g. method, class or jsp). diff --git a/src/docbkx/reference/preface.xml b/src/docbkx/reference/preface.xml index 937cb355c..6bb39580a 100644 --- a/src/docbkx/reference/preface.xml +++ b/src/docbkx/reference/preface.xml @@ -4,7 +4,7 @@ Reference Documentation
- Spring Data and Spring Data Graph + Spring Data and Spring Data Neo4j Spring Data is a SpringSource project that aims to @@ -14,14 +14,14 @@ - The Spring Data Graph project, as part of the Spring Data initiative, aims to simplify development + The Spring Data Neo4j project, as part of the Spring Data initiative, aims to simplify development with the Neo4j graph database. Like JPA, it uses annotations on simple POJO domain objects. - The annotations activate the AspectJ aspects in the Spring Data Graph framework, mapping the POJO entities + The annotations activate the AspectJ aspects in the Spring Data Neo4j framework, mapping the POJO entities and their fields to nodes, relationships, and properties in the graph database. - Spring Data Graph allows, at anytime, to drop down to the Neo4j-API level to execute functionality with + Spring Data Neo4j allows, at anytime, to drop down to the Neo4j-API level to execute functionality with the highest performance possible. @@ -33,8 +33,8 @@
Reference Documentation Overview - The explanation of Spring Data Graphs programming model starts with some underlying details. - The basic internal workings of Spring Data Graph are explained in the initial chapter about AspectJ . + The explanation of Spring Data Neo4js programming model starts with some underlying details. + The basic internal workings of Spring Data Neo4j are explained in the initial chapter about AspectJ . It also explains some of the common issues around AspectJ tooling with the current IDEs. @@ -50,7 +50,7 @@ Relationships between entities are first class citizens in a graph database and therefore worth a separate - chapter describing their usage in Spring Data Graph. + chapter describing their usage in Spring Data Neo4j. To add fields that are just backed by graph operations is a bit more involved. First you should know @@ -61,18 +61,18 @@ You might probably use the additional entity methods (see ) that are added to your - domain objects by Spring Data Graph. Those allow you to manage the entity lifecycles as well as to connect entities. + domain objects by Spring Data Neo4j. Those allow you to manage the entity lifecycles 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. 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 Graph maintains automatic indexes per entity class, with @Indexed annotations on relevant fields. + Spring Data Neo4j maintains automatic indexes per entity class, with @Indexed annotations on relevant fields. () If you don't want to go the path of persistence aware domain objects (Active-Record) but rather use a DAO layer, - Spring Data Commons provides a repository abstraction that is also implemented in Spring Data Graph. Those repositories + Spring Data Commons provides a repository abstraction that is also implemented in Spring Data Neo4j. Those repositories just consist of a composition of interfaces that declare the available methods on the concrete repository. The implementation details are handled by the library. At least for typical CRUD, Index- and Query-operatoins that is very convenient. For custom implementations of repository methods you are free to add your own code. (). @@ -85,12 +85,12 @@ The need of an active transaction for mutating the state of nodes or relationships implies that direct changes to the graph are only possible in a transactional context. Unfortunately many higher level application layers don't want to care about transactions and the open-session-in-view pattern is not widely used. Therefore Spring Data - Graph introduced an entity lifecyle and added support for detached entities which can be used for temporary + Neo4j 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. () - Unlike Neo4j which is a schema free database, Spring Data Graph works on Java domain objects. So it needs to store + Unlike Neo4j which is a schema free database, Spring Data Neo4j works on Java domain objects. So it needs to store the type information of the entities in the graph to be able to reconstruct them when just nodes are retrieved. To achieve that it employs type-representation-strategies which are described in a separate chapter. () @@ -101,29 +101,29 @@ or hierarchies. How that works is explained here: . - Spring Data Graph offers basic support for bean property validation (JSR-303). Annotations from that JSR are recognized + 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 ) - Unfortunately the setup of Spring Data Graph is more involved than we'd like. That is partly due to the maven setup + Unfortunately the setup of Spring Data Neo4j is more involved than we'd like. That is partly due to the maven setup and dependencies, which can be alleviated by using different build systems like gradle or ant/ivy. The Spring configuration - itself boils down to two lines of <datagraph> namespace setup. (see ) + itself boils down to two lines of <spring-neo4j> namespace setup. (see ) - Spring Data Graph can also be used in a JPA environment to add graph features to your JPA entities. In the + 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 provided samples, which are also publicly hosted on github are explained in . - The performance implications of using Spring Data Graph are detailed in . This chapter also discusses - which usecases should be handled with Spring Data Graph and when it should not be used. + The performance implications of using Spring Data Neo4j are detailed in . This chapter also discusses + which usecases should be handled with Spring Data Neo4j and when it should not be used. - Being a Spring Data library, Spring Data Graph also implements a comprehensive template for interacting with the Neo4j graph database. + Being a Spring Data library, Spring Data Neo4j also implements a comprehensive template for interacting with the Neo4j graph database. The Neo4jTemplate provides all basic graph operations as well as advanced querying with Indexes, Cypher, Gremlin and Traversals with a convenient API. @@ -132,15 +132,15 @@ are explained in . - How to consume the REST-API of a Neo4j-Server is the topic of . But Spring Data Graph can also + 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 would communicate via a domain level protocol with endpoints implemented - in Jersey and Spring Data Graph. + in Jersey and Spring Data Neo4j. - As Spring Data Graph is based on AspectJ and uses some advanced features of that toolset, please + As Spring Data Neo4j is based on AspectJ and uses some advanced features of that toolset, please be aware of that. Please 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 c664fab1d..4bdb2dcc5 100644 --- a/src/docbkx/reference/programming-model/aspectj.xml +++ b/src/docbkx/reference/programming-model/aspectj.xml @@ -3,11 +3,11 @@
AspectJ support - Behind the scenes, Spring Data Graph leverages AspectJ + Behind the scenes, Spring Data Neo4j leverages AspectJ aspects to modify the behavior of simple annotated POJO entities (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 Graph can retrieve the information from the entity's backing node or relationship in the database. + Spring Data Neo4j can retrieve the information from the entity's backing node or relationship in the database. The aspect introduces some internal fields and some public methods @@ -17,7 +17,7 @@ Introduced methods for equals() and hashCode() use the underlying node or relationship. - Spring Data Graph internally uses an abstraction called EntityState that the field + Spring Data Neo4j internally uses an abstraction called EntityState that the field access and instantiation advices of the aspect delegate to. This way, the aspect code is kept to a minimum, focusing mainly on the pointcuts and delegation code. The EntityState then uses a number of FieldAccessorFactories to create a FieldAccessor instance per @@ -27,7 +27,7 @@
AspectJ IDE support - As Spring Data Graph uses some advanced features of AspectJ, users may experience issues with + As Spring Data Neo4j uses some advanced features of AspectJ, users may experience issues with their IDE reporting errors where in fact there are none. Features that might be reported wrongfully include: introduction of methods to interfaces, declaration of additional interfaces for annotated classes, and generified introduced methods. diff --git a/src/docbkx/reference/programming-model/attachdetach.xml b/src/docbkx/reference/programming-model/attachdetach.xml index 7275ab28a..b1107690c 100644 --- a/src/docbkx/reference/programming-model/attachdetach.xml +++ b/src/docbkx/reference/programming-model/attachdetach.xml @@ -69,7 +69,7 @@ movie.setTopActor(actor); Neither the actor nor the movie has been assigned a node in the graph. If we were to call - movie.persist(), then Spring Data Graph would first create a node for the movie. + movie.persist(), then Spring Data Neo4j would first create a node for the movie. It would then note that there is a relationship to an actor, so it would call actor.persist() in a cascading fashion. Once the actor has been persisted, it will create the relationship from the movie to the actor. All of this will be done atomically in one transaction. diff --git a/src/docbkx/reference/programming-model/beanvalidation.xml b/src/docbkx/reference/programming-model/beanvalidation.xml index a360a22cc..989b4060a 100644 --- a/src/docbkx/reference/programming-model/beanvalidation.xml +++ b/src/docbkx/reference/programming-model/beanvalidation.xml @@ -3,7 +3,7 @@
Bean validation (JSR-303) - Spring Data Graph supports property-based validation support. When a property is changed, it is + Spring Data Neo4j supports property-based validation support. When a property is changed, it is checked against the annotated constraints, e.g. @Min, @Max, @Size, etc. Validation errors throw a ValidationException. The validation support that comes with Spring is used for evaluating the constraints. To use this feature, a validator diff --git a/src/docbkx/reference/programming-model/indexing.xml b/src/docbkx/reference/programming-model/indexing.xml index 51e6c11b6..28af3122f 100644 --- a/src/docbkx/reference/programming-model/indexing.xml +++ b/src/docbkx/reference/programming-model/indexing.xml @@ -13,7 +13,7 @@ Exact and numeric index When using the standard Neo4j API, nodes and relationships have to be manually indexed with - key-value pairs, typically being the property name and value. When using Spring Data Graph, + key-value pairs, typically being the property name and value. When using Spring Data Neo4j, this task is simplified to just adding an @Indexed annotation on entity fields by which the entity should be searchable. This will result in automatic updates of the index every time an indexed field changes. @@ -62,7 +62,7 @@ for (Person middleAgedDeveloper : graphRepository.findAllByRange("age", 20, 40))
Fulltext indexes - Spring Data Graph also supports fulltext indexes. By default, indexed fields are stored in + Spring Data Neo4j also supports fulltext indexes. By default, indexed fields are stored in an exact lookup index. To have them analyzed and prepared for fulltext search, the @Indexed annotation has the boolean fulltext attribute. diff --git a/src/docbkx/reference/programming-model/node-entities.xml b/src/docbkx/reference/programming-model/node-entities.xml index 55acbc6ce..993e82867 100644 --- a/src/docbkx/reference/programming-model/node-entities.xml +++ b/src/docbkx/reference/programming-model/node-entities.xml @@ -44,7 +44,7 @@ public class Movie { It is not necessary to annotate data fields, as they are persisted by default; all fields that contain primitive values are persisted directly to the graph. All fields convertible to String - using the Spring conversion services will be stored as a string. Spring Data Graph includes a + using the Spring conversion services will be stored as a string. Spring Data Neo4j includes a custom conversion factory that comes with converters for Enums and Dates. Transient fields are not persisted. @@ -75,7 +75,7 @@ public class Movie { @Query: fields as query result views The @Query annotation leverages the delegation infrastructure used by the - Spring Data Graph aspects. It provides dynamic fields which, when accessed, return the values + Spring Data Neo4j aspects. It provides dynamic fields which, when accessed, return the values selected by the provided query language expression. The provided query must contain a placeholder named %start for the id of the current entity. For instance start n=(%start) match n-[:FRIEND]->friend return friend. Graph queries can return variable number of entities. That's why annotation can be put onto fields @@ -104,7 +104,7 @@ public class Group { @GraphTraversal: fields as traversal result views The @GraphTraversal annotation leverages the delegation infrastructure used by the - Spring Data Graph aspects. It provides dynamic fields which, when accessed, return an Iterable + Spring Data Neo4j aspects. It provides dynamic fields which, when accessed, return an Iterable of node entities that are the result of a traversal starting at the entity containing the field. The TraversalDescription used for this is created by the FieldTraversalDescriptionBuilder class defined by the traversalBuilder diff --git a/src/docbkx/reference/programming-model/programming-model.xml b/src/docbkx/reference/programming-model/programming-model.xml index 27267cd4c..4a740ebea 100644 --- a/src/docbkx/reference/programming-model/programming-model.xml +++ b/src/docbkx/reference/programming-model/programming-model.xml @@ -3,10 +3,10 @@ Programming model - This chapter covers the fundamentals of the programming model behind Spring Data Graph. It discusses the - AspectJ features used and the annotations provided by Spring Data Graph and how to use them. + This chapter covers the fundamentals of the programming model behind Spring Data Neo4j. It discusses the + AspectJ features used and the annotations provided by Spring Data Neo4j and how to use them. Examples for this section are taken from the "IMDB" project of - Spring Data Graph examples. + Spring Data Neo4j examples. diff --git a/src/docbkx/reference/programming-model/projection.xml b/src/docbkx/reference/programming-model/projection.xml index 6bf282ec7..543f90e06 100644 --- a/src/docbkx/reference/programming-model/projection.xml +++ b/src/docbkx/reference/programming-model/projection.xml @@ -15,7 +15,7 @@ (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. - Spring Data Graph offers initial support for projecting node and relationship entities to different target + Spring Data Neo4j offers initial support for projecting node and relationship entities to different target types. All instances of this projected entity share the same backing node or relationship, so data changes are reflected immediately. diff --git a/src/docbkx/reference/programming-model/relationships.xml b/src/docbkx/reference/programming-model/relationships.xml index 47c66d682..4793a1802 100644 --- a/src/docbkx/reference/programming-model/relationships.xml +++ b/src/docbkx/reference/programming-model/relationships.xml @@ -6,19 +6,19 @@ Since relationships are first-class citizens in Neo4j, associations between node entities are represented by relationships. In general, relationships are categorized by a type, and start and end nodes (which imply the direction of the relationship). Relationships can have an arbitrary number of properties. - Spring Data Graph has special support to represent Neo4j relationships as entities too, but it is often + Spring Data Neo4j has special support to represent Neo4j relationships as entities too, but it is often not needed. - As of Neo4j 1.4.M03, circular references are allowed. Spring Data Graph reflects this accordingly. + 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 - in the graph. These relationships are managed by Spring Data Graph automatically. + in the graph. These relationships are managed by Spring Data Neo4j automatically. The simplest kind of relationship is a single field pointing to another node entity (1:1). @@ -56,15 +56,15 @@ public class Actor { Fields referencing other entities should not be manually initialized, as they are managed by - Spring Data Graph under the hood. 1:N fields can be accessed immediately, and Spring Data Graph + Spring Data Neo4j under the hood. 1:N fields can be accessed immediately, and Spring Data Neo4j will provide a java.util.Set representing the relationships. If the returned set is modified, - the changes are reflected in the graph. Spring Data Graph also ensures that there is only one + the changes are reflected in the graph. Spring Data Neo4j also ensures that there is only one relationship of a given type between any two given entities. Before an entity has been attached with persist() for the first time, it will - not have its state managed by Spring Data Graph. For example, given the Actor class defined above, + not have its state managed by Spring Data Neo4j. For example, given the Actor class defined above, if actor.movies was accessed in a non-persisted entity, it would return null, whereas if it was accessed in a persisted entity, it would return an empty managed set. diff --git a/src/docbkx/reference/programming-model/repositories.xml b/src/docbkx/reference/programming-model/repositories.xml index 1038c8abb..d734bb7b4 100644 --- a/src/docbkx/reference/programming-model/repositories.xml +++ b/src/docbkx/reference/programming-model/repositories.xml @@ -3,14 +3,14 @@
CRUD with repositories - The repositories provided by Spring Data Graph build on the composable repository infrastructure + The repositories provided by Spring Data Neo4j build on the composable repository infrastructure in Spring Data Commons. They allow for interface based composition of repositories consisting of provided default implementations for certain interfaces and additional custom implementations for other methods. - + @@ -20,11 +20,11 @@ - Spring Data Graph repositories support annotated and named queries for the Neo4j + Spring Data Neo4j repositories support annotated and named queries for the Neo4j Cypher query-language. - Spring Data Graph comes with typed repository implementations that provide methods for + Spring Data Neo4j comes with typed repository implementations that provide methods for locating node and relationship entities. There are 3 types of basic repository interfaces and implementations. CRUDRepository provides basic operations, IndexRepository and NamedIndexRepository delegate to Neo4j's internal @@ -147,8 +147,8 @@
Named Queries - Spring Data Graph also supports the notion of named queries which are externalized in property-config-files - (META-INF/graph-named-queries.properties). Those files have the format: + Spring Data Neo4j also supports the notion of named queries which are externalized in property-config-files + (META-INF/neo4j-named-queries.properties). Those files have the format: Entity.finderName=query (e.g. Person.findBoss=start p=(%person) match (p)<-[:BOSS]-(boss) return boss). Otherwise named queries support the same parameters as annotated queries. For using the named parameters you have to either annotate the parameters of the method with the @Param("person") annotation or enable debug symbols. @@ -256,7 +256,7 @@ public class PersonRepositoryImpl implements PersonRepositoryExtension { // configure the repositories, preferably via the datagraph:repositories namespace // (graphDatabaseContext reference is optional) - // have it injected diff --git a/src/docbkx/reference/programming-model/transactions.xml b/src/docbkx/reference/programming-model/transactions.xml index 39b36d998..d38081147 100644 --- a/src/docbkx/reference/programming-model/transactions.xml +++ b/src/docbkx/reference/programming-model/transactions.xml @@ -7,7 +7,7 @@ boundaries. Reading data does however not require transactions. - Spring Data Graph integrates with transaction managers configured using Spring. The simplest + Spring Data Neo4j integrates with transaction managers configured using Spring. The simplest scenario of just running the graph database uses a SpringTransactionManager provided by the Neo4j kernel to be used with Spring's JtaTransactionManager. That is, configuring Spring to use Neo4j's transaction manager. @@ -16,7 +16,7 @@ The explicit XML configuration given below is encoded in the Neo4jConfiguration configuration bean that uses Spring's @Configuration feature. This greatly - simplifies the configuration of Spring Data Graph. + simplifies the configuration of Spring Data Neo4j. @@ -70,7 +70,7 @@ One can also configure a stock XA transaction manager (e.g. Atomikos, JOTM, App-Server-TM) to be used with Neo4j and the other resources. For a bit less secure but fast 1 phase commit best effort, - use ChainedTransactionManager, which comes bundled with Spring Data Graph. It takes a + use ChainedTransactionManager, which comes bundled with Spring Data Neo4j. It takes a list of transaction managers as constructor params and will handle them in order for transaction start and commit (or rollback) in the reverse order. diff --git a/src/docbkx/reference/programming-model/typerepresentationstrategy.xml b/src/docbkx/reference/programming-model/typerepresentationstrategy.xml index 83f38ce1e..22eaa80a6 100644 --- a/src/docbkx/reference/programming-model/typerepresentationstrategy.xml +++ b/src/docbkx/reference/programming-model/typerepresentationstrategy.xml @@ -66,7 +66,7 @@ - Spring Data Graph will by default autodetect which are the most suitable strategies for node and relationship + Spring Data Neo4j will by default autodetect which are the most suitable strategies for node and relationship entities. For new data stores, it will always opt for the indexing strategies. If a data store was created with the olderSubReferenceNodeTypeRepresentationStrategy, then it will continue to use that strategy for node entities. It will however in that case use the no-op strategy for relationship entities, diff --git a/src/docbkx/reference/samples.xml b/src/docbkx/reference/samples.xml index fd1e5f09a..3d7c17933 100644 --- a/src/docbkx/reference/samples.xml +++ b/src/docbkx/reference/samples.xml @@ -7,8 +7,8 @@
Introduction - Spring Data Graph comes with a number of sample applications. The source code of the samples can be found on - Github. The different sample + Spring Data Neo4j comes with a number of sample applications. The source code of the samples can be found on + Github. The different sample projects are introduced below.
@@ -21,7 +21,7 @@ and then prints them.
- The unit tests demonstrate some other features of Spring Data Graph as well. The sample comes + The unit tests demonstrate some other features of Spring Data Neo4j as well. The sample comes with a minimal configuration for Maven and Spring to get up and running quickly. @@ -41,7 +41,7 @@ into the graph database. It allows the listing of movies with their actors, and of actors and their roles in different movies. It also uses graph traversal operations to calculate the Bacon number of any given actor. - This sample application shows the usage of Spring Data Graph in a more complex setting, using several + This sample application shows the usage of Spring Data Neo4j in a more complex setting, using several annotated entities and relationships as well as indexes and graph traversals. @@ -67,7 +67,7 @@ Simple, JPA-based web application for managing users and restaurants, with the ability to add restaurants as favorites to a user. It is basically the foundation for the MyRestaurants-Social application (see), and does therefore not use - Spring Data Graph. + Spring Data Neo4j. diff --git a/src/docbkx/reference/setup.xml b/src/docbkx/reference/setup.xml index 8d7f83eee..033b1fc40 100644 --- a/src/docbkx/reference/setup.xml +++ b/src/docbkx/reference/setup.xml @@ -3,20 +3,20 @@ Environment setup - Spring Data Graph dramatically simplifies development, but some setup is naturally required. - For building the application, Maven needs to be configured to include the Spring Data Graph dependencies, + Spring Data Neo4j dramatically simplifies development, but some setup is naturally required. + For building the application, Maven needs to be configured to include the Spring Data Neo4j dependencies, and configure the AspectJ weaving. After the build setup is complete, the Spring application needs to be - configured to make use of Spring Data Graph. + configured to make use of Spring Data Neo4j. - + - Spring Data Graph projects can be built using maven, we also added means to build them with gradle and ant/ivy. + Spring Data Neo4j projects can be built using maven, we also added means to build them with gradle and ant/ivy.
Gradle configuration - The necessary build plugin to build Spring Data Graph projects with gradle is available as part of the + The necessary build plugin to build Spring Data Neo4j projects with gradle is available as part of the SDG distribution or on github which makes the usage as easy as: @@ -25,11 +25,11 @@ targetCompatibility = 1.6 springVersion = "3.0.5.RELEASE" -springDataGraphVersion = "1.1.0" +springDataNeo4jVersion = "1.1.0" aspectjVersion = "1.6.12.M1 -apply from:'https://github.com/SpringSource/spring-data-graph/raw/master/build/ -gradle/springdatagraph.gradle' +apply from:'https://github.com/SpringSource/spring-data-neo4j/raw/master/build/ +gradle/springdataneo4j.gradle' configurations { runtime @@ -42,15 +42,15 @@ repositories { }]]> - The actual springdatagraph.gradle is very simple just decorating the javac tasks with the iajc ant task. + The actual springdataneo4j.gradle is very simple just decorating the javac tasks with the iajc ant task.
Ant/Ivy configuration The supplied sample ant build configuration is mainly about resolving - the dependencies for Spring Data Graph and AspectJ using Ivy and integrating the iajc ant task in the build. + url="https://github.com/SpringSource/spring-data-neo4j/raw/master/build/ivy">build configuration is mainly about resolving + the dependencies for Spring Data Neo4j and AspectJ using Ivy and integrating the iajc ant task in the build. Ant/Ivy Build Configuration @@ -73,14 +73,14 @@ repositories {
Maven configuration - Spring Data Graph projects are easiest to build with Apache Maven. The main dependencies are: Spring - Data Graph itself, Spring Data Commons, parts of the Spring Framework, and the Neo4j graph database. + Spring Data Neo4j projects are easiest to build with Apache Maven. The main dependencies are: Spring + Data Neo4j itself, Spring Data Commons, parts of the Spring Framework, and the Neo4j graph database.
Repositories - The milestone releases of Spring Data Graph are available from the dedicated milestone + The milestone releases of Spring Data Neo4j are available from the dedicated milestone repository. Neo4j releases and milestones are available from Maven Central. @@ -122,7 +122,7 @@ repositories {
AspectJ build configuration - Since Spring Data Graph uses AspectJ for build-time aspect weaving of entities, it is necessary to + Since Spring Data Neo4j uses AspectJ for build-time aspect weaving of entities, it is necessary to hook in the AspectJ Maven plugin to the build process. The plugin also has its own dependencies. You also need to explicitly specify the aspect libraries (spring-aspects and spring-data-neo4j). @@ -177,14 +177,14 @@ repositories {
Spring configuration - Users of Spring Data Graph have two ways of very concisely configuring it. Either they can use a - Spring Data Graph XML configuration namespace, or they can use a Java-based bean configuration. + Users of Spring Data Neo4j have two ways of very concisely configuring it. Either they can use a + Spring Data Neo4j XML configuration namespace, or they can use a Java-based bean configuration.
XML namespace - The XML namespace can be used to configure Spring Data Graph. The config element - provides an XML-based configuration of Spring Data Graph in one line. It has three attributes. + The XML namespace can be used to configure Spring Data Neo4j. The config element + provides an XML-based configuration of Spring Data Neo4j in one line. It has three attributes. graphDatabaseService points out the Neo4j instance to use. For convenience, storeDirectory can be set instead of graphDatabaseService to point to a directory where a new EmbeddedGraphDatabase will be created. For @@ -197,17 +197,17 @@ repositories { + http://www.springframework.org/schema/data/neo4j + http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd"> - + ]]> @@ -221,7 +221,7 @@ repositories { - + ]]> @@ -234,7 +234,7 @@ repositories { - ]]> @@ -242,7 +242,7 @@ repositories {
Java-based bean configuration - You can also configure Spring Data Graph using Java-based bean metadata. + You can also configure Spring Data Neo4j using Java-based bean metadata. @@ -255,7 +255,7 @@ repositories { - In order to configure Spring Data Graph with Java-based bean metadata, the class + In order to configure Spring Data Neo4j with Java-based bean metadata, the class Neo4jConfiguration is registered with the context. This is either done explicitly in the context configuration, or via classpath scanning for classes that have the @Configuration annotation. The only thing that must be provided is the diff --git a/src/docbkx/tutorial/annotations.xml b/src/docbkx/tutorial/annotations.xml index 34f548582..c55f24880 100644 --- a/src/docbkx/tutorial/annotations.xml +++ b/src/docbkx/tutorial/annotations.xml @@ -4,8 +4,8 @@ Annotating the domain Decorations - Looking at the Spring Data Graph documentation, we found a simple - Hello World example + Looking at the Spring Data Neo4j documentation, we found a simple + Hello World example and tried to understand it. The entity classes were annotated with @NodeEntity. That was simple, so we added the annotation to our domain classes too. Entity classes representing relationships were instead annotated with @RelationshipEntity. diff --git a/src/docbkx/tutorial/relationships.xml b/src/docbkx/tutorial/relationships.xml index c9fa4c8f4..f372f4800 100644 --- a/src/docbkx/tutorial/relationships.xml +++ b/src/docbkx/tutorial/relationships.xml @@ -99,7 +99,7 @@ class Actor { While reading about these relationship collections, we learned that they are actually - Spring Data Graph-managed sets. So whenever we add or remove something from the set, + Spring Data Neo4j-managed sets. So whenever we add or remove something from the set, it automatically gets reflected in the underlying relationships. That's neat! But this also meant we did not need to initialize the fields. That could be easy to forget. diff --git a/src/docbkx/tutorial/repository.xml b/src/docbkx/tutorial/repository.xml index c9e6a8ce1..1fb1967a4 100644 --- a/src/docbkx/tutorial/repository.xml +++ b/src/docbkx/tutorial/repository.xml @@ -16,7 +16,7 @@ public interface MovieRepository extends GraphRepository {} Then we added it to the Spring context configuration by simply adding: Repository context configuration - + ]]> We then created the domain-specific repository class, annotating it with @Repository and diff --git a/src/docbkx/tutorial/setup.xml b/src/docbkx/tutorial/setup.xml index dfe679abe..68b273a8d 100644 --- a/src/docbkx/tutorial/setup.xml +++ b/src/docbkx/tutorial/setup.xml @@ -17,7 +17,7 @@ the convenience of the Spring programming model to NOSQL databases. That should be in line with what we already know, providing us with a quick start. We had a look at the list of projects supporting the different NOSQL databases out there. Only one of them mentioned the kind of social - network we were thinking of - Spring Data Graph for Neo4j, a graph database. Neo4j's slogan of + network we were thinking of - Spring Data Neo4j for the Neo4j graph database. Neo4j's slogan of "value in relationships" and the accompanying docs looked like what we needed. We decided to give it a try. @@ -90,8 +90,8 @@ showing a static view. See the Spring Framework documentation for information on doing this. - - + + diff --git a/src/docbkx/tutorial/social.xml b/src/docbkx/tutorial/social.xml index 1a8a4ae37..9c7eebc3f 100644 --- a/src/docbkx/tutorial/social.xml +++ b/src/docbkx/tutorial/social.xml @@ -11,7 +11,7 @@ Users So we started out by taking the User class that we'd already coded and made it a - full-fledged Spring Data Graph entity. We added the ability to make friends and to + full-fledged Spring Data Neo4j entity. We added the ability to make friends and to rate movies. With that we also added a simple UserRepository that was able to look up users by ID. diff --git a/src/docbkx/tutorial/spring-data-graph.xml b/src/docbkx/tutorial/spring-data-neo4j.xml similarity index 85% rename from src/docbkx/tutorial/spring-data-graph.xml rename to src/docbkx/tutorial/spring-data-neo4j.xml index 2ac3e9655..f22a59e9c 100644 --- a/src/docbkx/tutorial/spring-data-graph.xml +++ b/src/docbkx/tutorial/spring-data-neo4j.xml @@ -1,15 +1,15 @@ - Spring Data Graph + Spring Data Neo4j Conjuring magic So far it had all been pure Spring Framework and Neo4j. However, using the Neo4j code in our domain classes polluted them with graph database details. For this application, we wanted to keep the domain - classes clean. Spring Data Graph promised to do the heavy lifting for us, so we continued investigating it. + classes clean. Spring Data Neo4j promised to do the heavy lifting for us, so we continued investigating it. - Spring Data Graph depends heavily on AspectJ features. + Spring Data Neo4j depends heavily on AspectJ features. Some parts of our classes would get new behavior, but it would not be visible in our code. The upside of this is that you get rid of a lot of boilerplate code. @@ -17,7 +17,7 @@ The first step was to configure Maven: - Spring Data Graph Maven configuration + Spring Data Neo4j Maven configuration 1.6.12.M1 @@ -82,13 +82,13 @@ - Spring Data Graph context configuration + Spring Data Neo4j context configuration + xmlns:neo4j="http://www.springframework.org/schema/data/neo4j" + xsi:schemaLocation="... http://www.springframework.org/schema/data/neo4j + http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd"> ... - + ... ]]> diff --git a/src/docbkx/tutorial/user-experience.xml b/src/docbkx/tutorial/user-experience.xml index d67c80fa4..468366d29 100644 --- a/src/docbkx/tutorial/user-experience.xml +++ b/src/docbkx/tutorial/user-experience.xml @@ -9,7 +9,7 @@ were impressive. This sections presents some of the remaining screen shots of Cineasts.net. - Some noteworthy things. Since Spring Data Graph reads through down to the database for property + Some noteworthy things. Since Spring Data Neo4j reads through down to the database for property and relationship access, we tried to minimize that by using <c:var/> several times. The app contains very little javascript / ajax code right now, that will change when it moves ahead.