Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import grails.util.GrailsUtil
- class BootStrap {
- def init = { servletContext ->
- if (GrailsUtil.isDevelopmentEnv()) {
- Book.collection.drop()
- def node = new Book(title: "Groovy for Enterprise")
- node.tags = ["A", "B"]
- node.authors = ["A. Brown", "B. Jones"]
- node.mongoInsert()
- node = new Book(title: "MongoDB for BI")
- node.tags = ["B", "C"]
- node.authors = ["A. Brown", "C. Homes"]
- node.mongoInsert()
- node = new Book(title: "Grails for the WEB")
- node.tags = ["A", "C"]
- node.authors = ["A. Birds", "B. Simsons"]
- node.mongoInsert()
- (100..199).each {
- node = new Book(title: "Journal of Health Technology Vol: $it")
- node.mongoInsert()
- }
- }
- }
- def destroy = {
- }
- }
Add Comment
Please, Sign In to add comment