Hello,

I'm not 100% sure if I understood what you're really after. Maybe, a bit of
code to show your intent by example might help...?

In any case, I can already answer some of your questions:

2015-04-21 12:57 GMT+02:00 <[email protected]>:

> Hi,
>
> i am new to JOOQ. May I ask if this possible
>
> 1. specify a list of interfaces that represent DTO, for instance IMyBook
>

You can use generator strategies to add interfaces to generated DTOs
(POJOs):

-
http://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy/
-
http://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/

Essentially, you're looking for the "class implements" property:

    /**
     * Override this method to define the interfaces to be implemented by those
     * artefacts that allow for custom interface implementation
     */
    @Override
    public List<String> getJavaClassImplements(Definition definition,
Mode mode) {
        return Arrays.asList(Serializable.class.getName(),
Cloneable.class.getName());
    }


Or:

          <!-- These elements influence the naming of a generated POJO
object.  -->
          <pojoClass> --> MatcherRule </pojoClass>
          <pojoExtends>com.example.MyOptionalCustomBaseClass</pojoExtends>
          <pojoImplements>com.example.MyOptionalCustomInterface</pojoImplements>


2. have the generator generate MYBOOK
> 3. so that i am able to use it in queries
> query.create().from(MYBOOK).where(MYBOOK.bookId.equals(...));
>

That already works - MYBOOK is of type org.jooq.Table. In order to map the
query result records into your DTO, you can use the into() methods. Details
can be found in the RecordMapper documentation:

http://www.jooq.org/doc/latest/manual/sql-execution/fetching/recordmapper/

Does this respond to your questions? Or did you have anything else in mind?

Best Regards,
Lukas

-- 
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.

Reply via email to