Spring Data Graph 1.1.0 with Neo4j support released
Dear Spring Community,
We are pleased to announce that the second release (1.1.0.RELEASE) of the Spring Data Graph project with Neo4j support is now available!
After the first public release of Spring Data Graph in April 2011 we mainly focused on user feedback.
With the improved documentation around the tooling and an upgraded AspectJ version we addressed many of the AspectJ issues that where reported by users. With the latest STS and Eclipse and hopefully with Idea11 it is possible to develop Spring Data Graph applications without the red wiggles. To further ease the development we also provided sample build scripts for ant/ivy and a plugin for gradle.
Of course we kept pace with development of Neo4j, currently using the latest stable release of Neo4j (1.4.1).
During the last months of Neo4j development the improved querying (Cypher, Gremlin) support was one of the important aspects. So we strove to support it on all levels. Now, it is possible to execute Cypher queries from Spring Data Graph Repositories, from the Neo4j-Template but also as part of dynamic field annotations and via the introduced entity methods. The same goes for Gremlin scripts. What's possible with this new expressive power? Let's take a look.
For example, in a repository:
public interface PersonRepository extends GraphRepository, NamedIndexRepository {
@Query("start team=(%team) match (team)-[:persons]->(member) return member")
Iterable findAllTeamMembers(@Param("team") Group team);
@Query(value = "g.v(team).out('persons')", type = QueryType.Gremlin)
Iterable findAllTeamMembersGremlin(@Param("team") Group team);
}
The Neo4j Template API got a complete overhaul which resulted in much fewer, more focused methods. The advanced query result handling capabilities (type conversion, mapping, single results, handler, etc.) are now implemented using a more fluent API. This new API is available for all types of queries, whether index lookups, graph traversals, Cypher queries or Gremlin scripts.
template.query("start n=(0) match n-->m return m", null).to(Node.class);
template.execute("g.v(0).out", null).to(Node.class);
template.lookup("relationship", "name", "rel1").to(String.class, new PropertyContainerNameConverter()).single();
template.traverse(referenceNode, traversalDescription).handle(new Handler<Path>() {
public void handle(Path value) {
final String name = (String) value.endNode().getProperty("name", "");
resultSet.add(name…