【问题标题】:Grails, attribute in the relationship (join table)Grails,关系中的属性(连接表)
【发布时间】:2011-08-05 06:45:19
【问题描述】:

如何使用 grails 在连接表中的关系上创建属性。 例如:A 类与 B 类作为角色 X。A 类与 C 类作为角色 Y。 是否可以使用 postgresql 进行类继承(每个类一个表)?

【问题讨论】:

    标签: hibernate postgresql grails grails-orm


    【解决方案1】:

    问题 1:要包含额外数据,您需要create a custom mapping,以便您存储更多信息,而不仅仅是关系。

    问题 2:Please read the manual,其中包含有关继承的详细信息。可以自定义继承以使用多个表或单个表。此外,Grails 2.0 (in development right now) 支持从类中更轻松、自动地继承。

    【讨论】:

    • 我试过了:static mapping = { table 'tablename' } 但是没有生成表...应该如何进行映射?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-22
    • 1970-01-01
    • 2012-05-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多