Grails, attribute in the relationship (join table)
With grails how can I make an attribute on a relation in the join table. like: Class A in relation with Class B as a role X. Class A in relation with Class C as a role Y. And is it possible using postgresql to have class inh开发者_JAVA技巧eritance (a table for each class)?
Question 1: To include extra data, you'll need to create a custom mapping that allows you to store more information than just the relationship.
Question 2: Please read the manual which contains detailed information on inheritance. It is possible to customize the inheritance to use multiple tables or a single table. Also, Grails 2.0 (in development right now) supports even easier, automated inheritance right from the classes.
精彩评论