> >> What would be the use-case for such interfaces (especially for the
> >> tables)? I can add a feature-request when I understand the goal...
>
> > We are integrating jOOQ generated classes into an existing codebase,
> > and I have a need to pass around record and/or table objects. In order
> > to provide mock implementations we would like to pass around
> > references to interfaces (like IPost) instead of references to class
> > objects (like Post).
>
> I can see how mock interfaces can help with records (mocking getter /
> setter behaviour), but how would it help with table objects? Table
> objects don't have any methods that are not defined in any org.jooq.*
> interfaces...?

You are right here. We don't need to have the table objects as
interfaces. I didn't think that through carefully enough.

> Note, also for records, you could use the org.jooq.Record interface
> and similar ones:
>
> http://www.jooq.org/javadoc/latest/org/jooq/Record.htmlhttp://www.jooq.org/javadoc/latest/org/jooq/TableRecord.htmlhttp://www.jooq.org/javadoc/latest/org/jooq/UpdatableRecord.html
>
> generated getters / setters are just convenience for calling
> Record.getValue() and setValue():
>
> http://www.jooq.org/javadoc/latest/org/jooq/Record.html#getValue%28or...http://www.jooq.org/javadoc/latest/org/jooq/Record.html#setValue%28or...
>
> Maybe that could help?

I think we would prefer to have the field getters/setters available in
the interface. I also think we would prefer to have our own defined
interface  to completely separate out jOOQ from our internal models.

> >> Note that you can already let jOOQ generate "implements" clauses in
> >> generated classes, as documented 
> >> here:http://www.jooq.org/manual/META/AdvancedConfiguration/
>
> >> Using a custom generator strategy, you can define
> >> getJavaClassImplements() for every generated artefact.
>
> > This is one of those java things I don't quite understand how to do. I
> > can create the .java file with the above mentioned code, but then I am
> > a little lost on what to do with it. I'm guessing I need to somehow
> > create a jar file, and include that on the classpath when I execute
> > jOOQ. Is that correct?
>
> That depends on how you generate code. With maven, it's a bit more
> complicated. You'll have to create a proper module. This was recently
> discussed and explained with the help of various jOOQ 
> users:https://groups.google.com/d/topic/jooq-user/o_eN0g6XjyM/discussion
>
> With ant / standalone Java, you just have to compile that class and
> make it available on the classpath for code generation. It doesn't
> have to be in a .jar file

Thanks for the info, I will have to read more on how to do this.

> > Also, it doesn't appear like the getJavaClassImplements is documented
> > anywhere. Any help, or examples of what should be implemented would be
> > appreciated.
>
> Yes, that is missing, you're right. It should be added, soon


Greg

Reply via email to