My Alert
has many Location
objects, and I have the join table alert_locations
.
The generated columns are:
alerts_locations_id
(I want this to be alert_id
)
location_id
Here's my domain object:
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)
}
}
static mapping = {
locations joinTable:[column:"location_id", key:"alert_id"]