-
-
Save tyama/5823798 to your computer and use it in GitHub Desktop.
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
@GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core') | |
@Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT') | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1') | |
import grails.persistence.* | |
import org.grails.datastore.gorm.mongo.config.* | |
MongoDatastoreConfigurer.configure("myDatabase", Book) | |
Book.withSession { | |
new Book(title:"The Stand").save(flush:true) | |
Book.list().each { | |
println it.title | |
} | |
} | |
@Entity | |
class Book { | |
String title | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment