... as a follow up on these experiments: The way jOOQ currently generates tables, it's quite hard to implement table inheritance within the generated artefacts. The reason for this is that org.jooq.Table is parameterised with <R extends Record>. Correlating the table hierarchy with the generic parameter's record hierarchy is hard. The reasons for this are explained here: http://blog.jooq.org/2013/06/28/the-dangers-of-correlating-subtype-polymorphism-with-generic-polymorphism/
Essentially, it means that parent tables would have to become generic themselves, for their child tables to be able to extend the generic type parameter, which might bring a lot of inconsistency into the type hierarchy. I'll have to think through this again, but it might not be possible without breaking backwards-compatibility to map PostgreSQL table inheritance to jOOQ table inheritance. Cheers Lukas 2013/10/15 Lukas Eder <[email protected]> > I'm currently looking into supporting PostgreSQL's table inheritance in > jOOQ's code generator. PostgreSQL also supports multiple inheritance, e.g: > > CREATE TABLE t_inheritance_all ( > text_1_all text > ) INHERITS (t_inheritance_1_1, t_inheritance_1_2) > > > This cannot be mapped to Java very easily. I would say that such > relationships would not be reflected in the generated code, and a warning > would be issued by the code generator. > > Does anyone on this list have any experience with multiple inheritance in > PostgreSQL? > > Cheers > Lukas > > > 2013/10/10 Jason Dusek <[email protected]> > >> When a Postgres table has other tables that inherit from, a SELECT >> against the parent will show rows in all the children, as well. The >> antidote to this is the ONLY keyword: >> >> SELECT * FROM ONLY <name-of-parent-table> >> >> Is inheritance recognized by jOOQ? Are there options for making ONLY the >> default for different models/tables? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jOOQ User Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
