Skip to content

Instantly share code, notes, and snippets.

@jexp
Created July 7, 2011 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jexp/1069531 to your computer and use it in GitHub Desktop.
Save jexp/1069531 to your computer and use it in GitHub Desktop.
Spring Data Graph Roo Addon Sample Script for Movies and Actors
pgp trust --keyId 0x29C2D8FD
addon install bundle --bundleSymbolicName org.springframework.datastore.neo4j.roo.addon;1.1.0
project --topLevelPackage org.neo4j.imdb
graph setup --provider NEO4J --databaseLocation target/imdb
graph entity --class ~.model.Movie
field string title
field number --fieldName year --type java.lang.Integer --permitReservedWords --primitive
graph entity --class ~.model.Actor
field string name
graph relationship --to Movie --from Actor --fieldName movies --type ACTS_IN --cardinality MANY_TO_MANY
graph relationship --via ~.model.Role --to Movie --from Actor --fieldName roles --type ACTS_IN --cardinality ONE_TO_MANY
graph relationship --from Movie --to Actor --type ACTS_IN --fieldName actors --direction INCOMING --cardinality MANY_TO_MANY
field string --fieldName title --class ~.model.Role
controller scaffold --class ~.web.ActorController --entity ~.model.Actor
controller scaffold --class ~.web.MovieController --entity ~.model.Movie
controller scaffold --class ~.web.RoleController --entity ~.model.Role --disallowedOperations create,update,delete
controller all --package ~.web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment