Skip to content

sgougi/play21-frames-neo4j-plugin

Repository files navigation

What is Frames-Neo4j Plugin ?

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.

Features

Requirements

  • Java 5 or 6, 7
  • Play 2.2.1

Dependencies

  • Neo4j 2.0.1
  • TinkerPop BluePrints 2.5.0-SNAPSHOT

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.5.0-SNAPSHOT

  3. Publishing the Frames Module to your local repository

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

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

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

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

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

How to run sample applications and Usage

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.

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

Extended Annotations

For Models

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

For Controllers

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

Known Issues

Licence

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

About

Frames-Neo4j Plugin for play! framework 2

Resources

Stars

Watchers

Forks

Packages

No packages published