Advertisement
Guest User

coursemanager_roo script for "Spring Roo in Action"

a guest
May 5th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.35 KB | None | 0 0
  1. //This Roo 1.2 Script creates the basic maven coursemanager project from the book
  2. //"Spring Roo In Action" (Manning 2012). Tested under jdk1.5 but should work
  3. //in later versions. In order to use this project on jdk1.5 you need to explicitly add
  4. //jaxb-api and jaxb-impl as dependencies in the pom.xml
  5.  
  6. project --topLevelPackage org.rooina.coursemanager --projectName coursemanager_ch5
  7. //Create this db with the user assigned the proper permissions prior to running the script
  8. //or change database below (You can do this after creating the project too)
  9. jpa setup --database MYSQL --provider HIBERNATE --databaseName coursemanager_web --userName sa
  10.  
  11. entity jpa --class ~.model.Course --testAutomatically
  12. entity jpa --class ~.model.TrainingProgram --testAutomatically
  13. field string --fieldName name
  14.  
  15. focus --class ~.model.Course
  16. field reference --fieldName trainingProgram --type ~.model.TrainingProgram --cardinality MANY_TO_ONE
  17.  
  18. focus --class ~.model.TrainingProgram
  19. field set --fieldName courses --type ~.model.Course --cardinality ONE_TO_MANY --mappedBy trainingProgram
  20.  
  21. entity jpa --class ~.model.Tag --testAutomatically
  22. field string --fieldName tag --sizeMin 1 --sizeMax 25 --notNull
  23. field string --fieldName description --sizeMax 250 --notNull
  24. field set --fieldName courses --type ~.model.Course --cardinality MANY_TO_MANY
  25.  
  26. focus --class ~.model.Course
  27. field set --fieldName tags --type ~.model.Tag --cardinality MANY_TO_MANY --mappedBy courses
  28. entity jpa --class ~.model.Offering --abstract --inheritanceType SINGLE_TABLE
  29. entity jpa --class ~.model.SingleEvent --testAutomatically --extends ~.model.Offering
  30. entity jpa --class ~.model.PeriodicCourse --testAutomatically --extends ~.model.Offering
  31.  
  32. focus --class ~.model.Course
  33. field set --fieldName offerings --type ~.model.Offering --cardinality ONE_TO_MANY --mappedBy course
  34.  
  35. focus --class ~.model.Offering
  36. field reference --fieldName course --type ~.model.Course --cardinality MANY_TO_ONE
  37.  
  38. enum type --class ~.model.FrequencyType
  39. enum constant --name WEEKLY
  40. enum constant --name MONTHLY
  41. enum constant --name BIWEEKLY
  42.  
  43. focus --class ~.model.PeriodicCourse
  44. field date --fieldName startDate --type java.util.Date
  45. field enum --fieldName frequency --type ~.model.FrequencyType --notNull
  46. field date --fieldName endDate --type java.util.Date --notNull
  47.  
  48. web mvc setup
  49. web mvc all --package ~.web
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement