Created
August 6, 2011 08:01
-
-
Save kiy0taka/1129161 to your computer and use it in GitHub Desktop.
GroovyConsole on Play framework.
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
import play.db.jpa.JPA | |
import models.* | |
def jpa = new JPA() | |
def em = jpa.entityManager = JPA.newEntityManager() | |
JPA.local.set(jpa) | |
def trx = em.transaction | |
trx.begin() | |
def kiy0taka = new User('kiy0aka333@gmail.com', 'password', 'Kiyotaka Oku').save() | |
new Post(kiy0taka, 'はじめてのPlay!', 'GroovyConsole使ってみる').save() | |
trx.commit() |
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
Hello GroovyConsole! | |
${new groovy.ui.Console(Thread.currentThread().contextClassLoader).run()} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment