I have a legacy database that has a Hibernate join in it:
<join table="events_sub_seasons"
optional="false">
<key column="event_id" unique="true"/>
<many-to-one name="subSeason"开发者_运维百科
column="sub_season_id"
not-null="true"/>
</join>
I moved over to using GORM for the modeling, and I am not sure how to model this join and didn't see anything in the documentation. Right now I have it like this, but it doesn't work:
static mapping = {
subSeason joinTable: [name:'events_sub_seasons', optional:false, key:'event_id', column:'sub_season_id']
}
Any ideas? SubSeason subSeason;
Went back to Hibernate XML where it is working correctly, so this is no longer an issue.
精彩评论