Hello Ben,

> pardon the Scala

;-)

> duck type table references based on a
> commonality (e.g. a common column name)?

The best way to do so that, which I can think of right now, is to
specify marker interfaces to be implemented by tables with an ENDPOINT
column. Details can be seen in this section of the manual (better
examples will be provided after some jOOQ 3.0 improvements in that
area):
http://www.jooq.org/doc/2.6/manual/code-generation/codegen-advanced/

Essentially, you should override the following method in your custom
generator strategy implementation:
public List<String> getJavaClassImplements(Definition definition, Mode mode);

I'm guessing that once you've added such an interface (e.g.
"EndpointTable") to the relevant tables, you can do something like
this:
def deleteRecordsInSpace[R <: Record, T <: Table[R] with
EndpointTable](t: Factory, space: Long, table: T) = {

Currently, letting generated Table classes extend a custom base class
is not possible. This means that you would have to modify the
generator if your EndpointTable contained any methods. In jOOQ 3.0, it
should be easier to extend the standard code generator for such use
cases.

Cheers
Lukas

Reply via email to