0
我的Alert
有很多Location
對象,我有連接表alert_locations
。Grails加入表列名
生成的列有:
alerts_locations_id
(我想這是alert_id
)
location_id
這裏是我的域對象:Grails的的
class Alerts {
static hasMany = [locations:Locations,notifications:Notifications]
Date alertDateTime
String pest
String crop
static constraints = {
alertDateTime (blank:false)
pest (blank:false)
crop (blank:false)
}
}
可能重複控制連接表](http://stackoverflow.com/question S/8897524/Grails的控制聯接表) – 2012-01-17 16:51:28