Lukas, First: thanks for the quick answer :). Answers inline too.
On Tuesday, December 16, 2014 4:22:14 PM UTC+1, Lukas Eder wrote: > > > > What makes you feel this way? > > > You could do that, of course, but then your "POJO" wouldn't be a POJO but > a Record with all strings attached. > > You could also activate POJO generation in jOOQ and use jOOQ's > DefaultRecordMapper to map Records to POJOs: > > - http://www.jooq.org/doc/latest/manual/code-generation/codegen-pojos/ > - http://www.jooq.org/doc/latest/manual/sql-execution/fetching/pojos/ > > Well, I think I did not read that part carefully enough. I'll take a better look at it, and will come back with more precise questions if needed. Another way to do it would be: >> >> class A { >> private ARecord aRecord; >> public void setId(int id) { aRecord.setId(id); } >> public int getId() { return aRecord.getId(); } >> >> // additional behaviour >> } >> >> But that feels cumbersome to me. >> > > Yes. And why would you do it? Why not just pass around the record directly? > I agree, bad idea. > > >> 2. Same question, but including PostgreSQL inheritance feature >> >> As of now, I have 3 tables: >> - parent >> - childA inherits from parent >> - childB inherits from parent >> >> My Java objects are reflecting that tree : >> >> class Parent { ... } >> class childA extends parent { ... } >> class childB extends parent { ... } >> >> > >> So, I do not find a clean way to use these table. Of course, the Java >> children reuse some Parent behaviour. >> > > What do you want to do? > Basically: - use PG inheritance - use Java inheritance - use JOOQ - have clean code If I understand correctly the first part of your answer, I'll be able to generate POJOs for: - Parent - ChildA - ChildB But I won't have the inheritance link out of the box. Since Java does not allow me to write class enhancedClassA extends Parent, ChildA I can't find a clean way to get all PG / Java / JOOQ features working together. I hope you'll get what I mean. -- 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/d/optout.
