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"]       
    } 
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值