Skip to content

sgougi/play21-frames-orientdb-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Frames-OrientDB Plugin ?

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.

Features

  • 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:

Requirements

  • Java 5 or 6, 7
  • Play 2.2.1

Dependencies

  • OrientDB 1.5.1

Installing

  1. Install Play framework 2.2.1

  2. 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.4.4

  3. Publishing the Frames Module to your local repository

    % cd play21-frames-module % play publish-local

  4. Executing the command for installing the Frames-OrientDB Plugin

    % git clone git@github.com:sgougi/play21-frames-orientdb-plugin.git

  5. Publishing the Frames-OrientDB Plugin to your local repository

    % cd play21-frames-orientdb-plugin % play publish-local

Running sample application

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.

Facade Classes for GraphDB

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()

Extended Annotations

For Models

####@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");

For Controllers

####@WithGraphDB The @WithGraphDB annotation enables annotated Actions and/or Controllers to use OrientDB implicitly.

Known Issues

  • Nothing

Licence

Frames-OrientDB Plugin is distributed under the Apache 2 licence.

About

Frames-OrientDB Plugin for play! framework 2

Resources

Stars

Watchers

Forks

Packages

No packages published