开发者

Grails - Hibernate Join Element

开发者 https://www.devze.com 2023-03-15 15:49 出处:网络
I have a legacy database that has a Hibernate join in it: <join table=\"events_sub_seasons\" optional=\"false\">

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消