Grails 1.1 Beta 1发布,增强测试、Gorm、脚手架和插件系统
GORM
class Person { static hasMany = [nicknames:String]}?
person.properties = params?
person.properties["firstName","lastName"] = params?
person.properties["firstName","lastName"].each { println it }??
def book = Book.read(1)?
class Book { String title static mapping = { sort "title" }}?
class Author { static hasMany = [books:Book] static mapping = { books sort:"title" }}?
class Book { String title static mapping = { batchSize 15 }}?
class Author { static hasMany = [books:Book] static mapping = { books batchSize:15 }}?
def groovyBooks = Book.findByAuthorInList(['Dierk Koenig', 'Graeme Rocher'])?
def books = Book.findByTitle("Groovy in Action", [cache:true] )?
def books = Book.findByTitle("Groovy in Action", [lock:true] )?
class Book { String title static belongsTo = Author static hasMany = [authors:Author]static mapping = { authors joinTable:[name:"mm_author_books" , key:'mm_book_id' ] } } class Author { String name static hasMany = [books:Book] static mapping = { books joinTable:[name:"mm_author_books" , key:'mm_author_id'] } }?
?
?
?
插件grails.plugin.repos.discovery.myRepository="http://svn.codehaus.org/grails/trunk/grails-test-plugin-repo"grails.plugin.repos.distribution.myRepository="https://svn.codehaus.org/grails/trunk/grails-test-plugin-repo"?
?
Automatic Transitive Plugin Resolution现在插件不再需要被放到SVN中了,当Grails应用程序第一次载入时会通过插件的metadata进行自动安装。另外,插件的依赖问题也得到了解决。
?
?
新的测试框架在1.0.x的版本中以插件形式出现的测试框架(test framework)现在被集成到了Grails中。
?
?
?
脚手架?
模板和动态脚手架?
动态脚手架现在能够使用模板,可以通过install-templates命令来进行安装
相关模板
?
?
?
?
更多相关资源:
Changelog: http://jira.codehaus.org/browse/GRAILS?report=com.atlassian.jira.plugin.system.project:changelog-panel
Download: http://grails.org/Download
Documentation: http://grails.org/doc/1.1