Frames-Neo4j plugin is a Java O/G mapper for the Neo4j with the Play! framework 2. It is used with the TinkerPop Frames for O/G mapping.
- Object-Graph-Mapping by the TinkerPop Frames
- Java 5 or 6, 7
- Play 2.2.1
- Neo4j 2.0.1
- TinkerPop BluePrints 2.5.0-SNAPSHOT
-
Install Play framework 2.2.1
-
Executing the command for installing the TinkerPop Frames Module
% git clone git@github.com:sgougi/play21-frames-module.git % cd play21-frames-module % git checkout 2.5.0-SNAPSHOT
-
Publishing the Frames Module to your local repository
% cd play21-frames-module % play publish-local
-
Executing the command for installing the Frames-Neo4j Plugin
% git clone git@github.com:sgougi/play21-frames-neo4j-plugin.git
-
Publishing the Frames-Neo4j Plugin to your local repository
% cd play21-frames-neo4j-plugin % play publish-local
At a command prompt, type the following commands:
% cd play21-frames-neo4j-plugin
% cd samples
% cd frames-simple-app
% play run
There are basic usage in the source code of a sample application.
- Annotated model classes
- Creating a key index
- Application configuration: conf/application.conf
- Dependency settings: project/Build.scala
- Controller with transaction
The com.wingnest.play2.frames.GraphDB class is a Facade class.
- GraphDB.commit()
- GraphDB.rollback()
- GraphDB.getGraph()
- GraphDB.createFramedGraph()
- GraphDB.getGraphManager()
- GraphDB.createKeyIndex()
- GraphDB.dropKeyIndex()
- GraphDB.createIndex()
- GraphDB.dropIndex()
- GraphDB.getIndexedKeys()
- GraphDB.getIndex()
- GraphDB.getIndices()
####@Id Defines one attribute as id attribute.
ex:
public interface A {
...
@Id
public Object getId();
...
}
####@IndexedProperty Defines one or more attributes as indexed attribute.
ex:
public interface A {
...
@IndexedProperty("type")
public String getType();
@IndexedProperty("type")
public void setType(String type);
...
}
Index<Vertex> index = GraphDB.getIndex(A.class.getSimpleName(), Vertex.class);
Iterable<Vertex> types = index.get("type", "text");
####@WithGraphDB The @WithGraphDB annotation enables annotated Actions and/or Controllers to use Neo4j implicitly.
Frames-Neo4j Plugin is distributed under the Apache 2 licence.