Frames-OrientDB plugin is a Java O/G mapper for the OrientDB with the Play! framework 2. It is used with the TinkerPop Frames for O/G mapping.
-
Object-Graph-Mapping by the TinkerPop Frames
-
Support for both the embedded OrientDB and remote OrientDB
-
Auto-reloading support
-
Custom vertex and edge types support (sample)
- Note that Custom types, Constraints and Indexes are not yet implemented.
-
Support to enable to customize the format of Model Id (src)
-
On only embedded OrienDB:
- Support to enable to use the OrientDB Studio
- Java 5 or 6, 7
- Play 2.2.1
- OrientDB 1.5.1
-
Install Play framework 2.2.1
-
Executing the command for installing the TinkerPop Frames Module
% git clone [email protected]:sgougi/play21-frames-module.git % cd play21-frames-module % git checkout 2.4.4
-
Publishing the Frames Module to your local repository
% cd play21-frames-module % play publish-local
-
Executing the command for installing the Frames-OrientDB Plugin
% git clone [email protected]:sgougi/play21-frames-orientdb-plugin.git
-
Publishing the Frames-OrientDB Plugin to your local repository
% cd play21-frames-orientdb-plugin % play publish-local
At a command prompt, type the following commands:
% cd play21-frames-orientdb-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()
The com.wingnest.play2.frames.[OrientDB] (app/com/wingnest/play2/frames/OrientDB.java) class is a Facade class.
- OrientDB.fromCustomIdToORID()
- OrientDB.fromORIDToCustomId()
- OrientDB.setCustomIdHandler()
####@Id Defines one attribute as id attribute.
ex:
public interface A {
...
@Id
public Object getId();
...
}
####@CustomId Defines one attribute as custom id attribute. (ref:(CustomIdManager))
ex:
public interface A {
...
@CustomId
public Object getCustomId();
...
}
####@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 OrientDB implicitly.
- Nothing
Frames-OrientDB Plugin is distributed under the Apache 2 licence.