Hello,

I'm splitting this thread into two, it will be easier for future readers to
follow the discussion.
This thread will deal with the JSON-Mapping issue


2014-03-09 23:06 GMT+01:00 Stargate <[email protected]>:

> Hi,
>
> [...]
>
The reason why i need a POJO is that i must convert the Account Object in a
> JSON-Object.. i use the Jackson-Mapper for this.. This works with the POJO
> Objects but not with an AccountRecord..
>
> Is there an easy way to convert a record to a JSON-Object ?
>

jOOQ supports its own JSON serialisation through Result.formatJSON():
http://www.jooq.org/javadoc/latest/org/jooq/Result.html#formatJSON()

Currently, this is only supported on Results, not on Records.

Another option for custom, reusable Record to JSON conversion would be to
implement your own RecordMapper. Relevant sections in the manual can be
seen here:

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

jOOQ users have already successfully integrated jOOQ with ModelMapper, a
third-party tool to implement such mapping algorithms:

http://modelmapper.org/user-manual/jooq-integration/

This might be useful for your specific use-case as well.

Cheers
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