2013/8/19 Christian Hammers <[email protected]> > Hello > > I'm a big fan of the "Propel ORM" for PHP and one features that was > especially usefull was that it auto-generates two classes per table: > > class FooRecord extends BaseFooRecord { > // empty > } > > class BaseFooRecords extends BaseRecordOrWhatever { > // many, many functions > } > > While the latter is the equivalent to the "FooRecord", JOOQ would also > generate on every build, > the former is only created if it does not yet exists and would be placed > in src/main/java/ and > not in target/generated-classes/ in a Maven build. > > The benefit is that FooRecord can freely be extended with custom methods > like e.g. setFirstAndLastName(a, b), > toString(), a multi-argument constructor or even override special > preSave(), postLoad() methods that would > persist even if I add some new attribute to the table and have to > regenerate the "BaseFooRecord" class. > > With JPA and the model-first approach this would of course be no problem > as I could then add these functions to the > annotated POJO classes but with JOOQ's database-first approach I can't see > how I can add convenience methods > to the ActiveRecords. > > So would this be a nice feature for JOOQ? >
I can see the use-case. However, I think that it is important to make BaseFooRecords abstract and allow only instanciation of FooRecord. Similar things would apply to BaseFooDao and FooDao, as well as BaseFooPojo and FooPojo. I have registered #2705 for this https://github.com/jOOQ/jOOQ/issues/2705 -- 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.
