The Neo4j plugin enables lightweight access to database functionality using Neo4j. This plugin does NOT provide domain classes nor dynamic finders like GORM does.
The current version of griffon-neo4j is 0.1
To install just issue the following command
Upon installation the plugin will generate the following artifacts at
- Neo4jConfig.groovy - contains the database definition properties.
- BootstrapNeo4j.groovy - defines init/destroy hooks for data to be manipulated during app startup/shutdown.
A new dynamic method named
withNeo4j will be injected into all controllers, giving you access to an
org.neo4j.graph.GraphDatabaseService instance, with which you'll be able to make calls to the database. Remember to make all calls to the database off the EDT otherwise your application may appear unresponsive when doing long computations inside the EDT.
- create-relationship-type - creates a new enum that implements
The following methods and properties are added via MOP to Neo4j classes:
- Object getAt(String name) - enables array subscript notation to retrieve a property. Added to
- void putAt(String name, Object value) - enables array subscript notation to set a property. Added to
- Relationship relate(RelationshipType type, Node other) - another way to create a relationship between nodes. Maps to Node.createRelationshipTo(Node, RelationshipType).
- indexBy(String name) - indexes a node property using the current index and the property value. Added to Node.
- indexBy(List<String> names) - indexes a node by the specified property names and their values using the current index. Added to Node.
Dynamic method injection
Dynamic methods will be added to controllers by default. You can change this setting by adding a configuration flag in
The plugin will create an instance of
LuceneIndexService by default. You may change this setting by setting a configuration flag in
fulltext resolves top LuceneFulltextIndexService.
query resolves top LuceneFulltextQueryIndexService.