首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

Grails 1.1 Beta 一发布,增强测试、Gorm、脚手架和插件系统

2012-11-07 
Grails 1.1 Beta 1发布,增强测试、Gorm、脚手架和插件系统GORMclass Person {statichasMany [nicknames:St

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

热点排行