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

说明: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"]       
    } 
}

 

你可能感兴趣的:(Hibernate,grails)