On Tue, 20 Aug 2013 15:13:36 +0200 Lukas Eder <[email protected]> wrote:
> 2013/8/20 Durchholz, Joachim <[email protected]> > > > > This feature request is really very simple. > > > Inheritance is used only for the purpose of > > > being able to "tweak" generated classes to > > > hold new, custom methods. > > > > The issue isn't the intended purpose, but the potential side effects. > > > > What's worrying me most is the use case where people want to organize some > > of their entity classes as superclass and subclass. > > I.e. the application programmer wants > > > > class BarRecord extends FooRecord > > > > and can't make BarRecord a subclass of BaseBarRecord anymore. > > I don't see any way around this, other than telling people that > > inheritance between entity classes is incompatible with double-class > > generation. > > > I'm not sure if I follow. So far, no one wanted to mix entities Foo and > Bar, or do they? :-) At least not me! I'm not completely sure if I understand Joachim's concerns but at least Lukas seems to undestand what I wanted in my original mail :-) It's really only about *small* additions to the model classes for the sole reason of convenience. Using the Author/Book examples from the tutorial I could imagine the following "tweaks": target/generated-sources/BaseAuthorRecord.java: @javax.annotation.Generated(value = { "http://www.jooq.org", "3.1.0" }, public abstract class BaseAuthorRecord extends UpdatableRecordImpl<generated.tables.records.AuthorRecord> implements org.jooq.Record6<Integer, String, String, Date, Integer, Integer> { ... } src/main/java/model/AuthorRecord.java: /** * This class was autogenerated by JOOQ. * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. */ public class AuthorRecord extends AuthorRecord { /** My convenience constructor... */ public AuthorRecord(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public String toString() { return "This is Author " + firstName + " " + lastName; } } bye, -christian- -- 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.
