Created
July 7, 2011 13:44
-
-
Save jexp/1069531 to your computer and use it in GitHub Desktop.
Spring Data Graph Roo Addon Sample Script for Movies and Actors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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