documentation udpates, gremlin and cypher as optional maven dependencies

This commit is contained in:
Michael Hunger
2011-08-08 17:20:03 +02:00
parent b2e1350eef
commit f678631191
9 changed files with 36 additions and 19 deletions

View File

@@ -1,6 +1,13 @@
Spring Data Graph Changelog
===========================
Changes in version 1.1.0.RELEASE (2011-08-04)
---------------------------------------------
* documentation updates
* fixed package name in NamespaceHandler declaration
* cypher, gremlin as optional dependencies
*
Changes in version 1.1.0.RC1 (2011-07-25)
-----------------------------------------
* Added Gremlin support (embedded & REST)

View File

@@ -233,7 +233,14 @@
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j.version}</version>
<exclusions>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
@@ -247,6 +254,12 @@
<version>${neo4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher</artifactId>
<version>${neo4j.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>

View File

@@ -58,12 +58,14 @@
<groupId>org.neo4j.server.plugin</groupId>
<artifactId>neo4j-cypher-plugin</artifactId>
<version>${neo4j.version}</version>
<optional>true</optional>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j.server.plugin</groupId>
<artifactId>neo4j-gremlin-plugin</artifactId>
<version>${neo4j.version}</version>
<optional>true</optional>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -81,10 +81,10 @@ public class UserAccount {
@GraphProperty
String nickname;
@RelatedTo(type = "friends", elementClass = UserAccount.class)
@RelatedTo
Set<UserAccount> friends;
@RelatedToVia(type = "recommends", elementClass = Recommendation.class)
@RelatedToVia(type = "recommends")
Iterable<Recommendation> recommendations;
@Temporal(TemporalType.TIMESTAMP)
@@ -99,12 +99,10 @@ public class UserAccount {
@Column(name = "id")
private Long id;
@Transactional
public void knows(UserAccount friend) {
relateTo(friend, "friends");
}
@Transactional
public Recommendation rate(Restaurant restaurant, int stars, String comment) {
Recommendation recommendation = relateTo(restaurant, Recommendation.class, "recommends");
recommendation.rate(stars, comment);

View File

@@ -55,7 +55,7 @@
]]></programlisting>
</example>
Now, your resources can be annotated with the beans they need, like this:
Now, your resources can require the spring-beans they need, annotated with <code>@Context</code> like this:
<example>
<title>Jersey resource</title>
<programlisting language="java"><![CDATA[@Path( "/path" )
@@ -100,7 +100,7 @@ public void foo( @Context WorldRepository repo ) {
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>1.1.0.M2</version>
<version>1.1.0</version>
</dependency>
]]></programlisting>
</example>
@@ -110,7 +110,7 @@ public void foo( @Context WorldRepository repo ) {
<title>REST client configuration - application context</title>
<programlisting language="xml"><![CDATA[<datagraph:config graphDatabaseService="graphDatabaseService"/>
<bean id="graphDatabaseService" class="org.neo4j.rest.graphdb.RestGraphDatabase">
<bean id="graphDatabaseService" class="org.springframework.data.neo4j.rest.RestGraphDatabase">
<constructor-arg value="http://localhost:7474/db/data/"/>
</bean>
]]></programlisting>

View File

@@ -81,7 +81,7 @@ for (Person middleAgedDeveloper : graphRepository.findAllByRange("age", 20, 40))
<title>Fulltext indexing</title>
<programlisting language="java"><![CDATA[@NodeEntity
class Person {
@Indexed(indexName = "person-name", fulltext=true) String name;
@Indexed(indexName = "people-search", fulltext=true) String name;
}
GraphRepository<Person> graphRepository = graphRepositoryFactory
@@ -121,7 +121,7 @@ Index<Node> namedPersonIndex = gdc.getIndex(Person.class, "people");
namedPersonIndex.get("name", "Mark");
// Fulltext index
Index<Node> personFulltextIndex = gdc.getIndex(Person.class, "person-name", true);
Index<Node> personFulltextIndex = gdc.getIndex(Person.class, "people-search", true);
personFulltextIndex.query("name", "*cha*");
personFulltextIndex.query("{name:*cha*}");
]]></programlisting>

View File

@@ -29,7 +29,7 @@
<programlisting language="java"><![CDATA[@NodeEntity
class Trainee {
String name;
@RelatedTo(elementClass=Training.class);
@RelatedTo
Set<Training> trainings;
}

View File

@@ -40,19 +40,16 @@ public class Movie {
It is also possible to have fields that reference a set of node entities (1:N). These fields come in
two forms, modifiable or read-only. Modifiable fields are of the type <code>java.util.Set&lt;T></code>,
and read-only fields are <code>java.lang.Iterable&lt;T></code>, where T is a @NodeEntity-annotated
class. The Java implementation of generics uses type erasure, meaning that the type parameters are
typically not available at runtime. Therefore, the <code>elementClass</code> attribute must be
specified on the annotation, which must always be present for 1:N fields.
class.
</para>
<example>
<title>Node entity with relationships</title>
<programlisting language="java"><![CDATA[@NodeEntity
public class Actor {
@RelatedTo(type = "mostPaidActor", direction = Direction.INCOMING,
elementClass = Movie.class)
@RelatedTo(type = "mostPaidActor", direction = Direction.INCOMING)
private Set<Movie> mostPaidIn;
@RelatedTo(type = "ACTS_IN", elementClass = Movie.class)
@RelatedTo(type = "ACTS_IN")
private Set<Movie> movies;
}
]]></programlisting>
@@ -157,7 +154,7 @@ public class Role {
<title>Accessing relationship entities using @RelatedToVia</title>
<programlisting language="java"><![CDATA[@NodeEntity
public class Actor {
@RelatedToVia(type = "ACTS_IN", elementClass = Role.class)
@RelatedToVia(type = "ACTS_IN")
private Iterable<Role> roles;
public Role playedIn(Movie movie, String title) {

View File

@@ -25,7 +25,7 @@
targetCompatibility = 1.6
springVersion = "3.0.5.RELEASE"
springDataGraphVersion = "1.1.0.M2"
springDataGraphVersion = "1.1.0"
aspectjVersion = "1.6.12.M1
apply from:'https://github.com/SpringSource/spring-data-graph/raw/master/build/
@@ -107,7 +107,7 @@ repositories {
<programlisting language="xml"><![CDATA[<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>1.1.0.M2</version>
<version>1.1.0</version>
</dependency>
<dependency>