ITeye博客

grails 1.1 Gorm 部分新特性提前知道

dellsoft · 2008-10-30 17:21 · grails · Markdown

说明:grails 1.1部分新特性,我只是看 grails 的fisheye 代码链接到的jira 看到的

 

具:nabble forum 消息:grails 1.1beta1 将会在 11月下旬发布,beta2版本计划 12月底,rc正式版本要到 2009-1月份

 

1)支持 hibernate 的dynaimc-update 就是只对修改过的数据进行更新,通过下面方法

static mapping = {


     dynamicUpdate true


     dynamicInsert true


} 

 

2)对集合的支持 http://jira.codehaus.org/browse/GRAILS-1023

class Person {


    static  hasMany = [nicknames:String

]


}

 

GORM now supports basic collection types using a join table:

person_id 	string
1 	"joejoe"
1 	"yoyo"

 

 

Grails will map a new join table called "person_nicknames":

You can change the mapping using the joinTable argument:

class Person {
    static hasMany = [nicknames:String]

    static mapping = {
       hasMany joinTable:[name:'bunch_o_nicknames', key:'person_id', column:'nickname', type:"text"]       
    } 
}

评论(2)

  1. #2 楼 · dellsoft · 2008-10-30 22:15

    不好意思,记错了,我凭印象写,谢谢提醒 。更正了

  2. #1 楼 · JohnnyJian · 2008-10-30 20:24

    是你看错了还是我看错啦?Graeme Rocher说: “We'll be doing a beta 1 at the end of November, beta 2 at the end of December and release candidates in January”

评论功能维护中,当前仅展示历史评论。