Hi Marcel,

On Mon, Mar 18, 2024 at 3:38 PM Marcel Overdijk <[email protected]>
wrote:

> Hi Lukas, and thanks for your reply. This helps a lot.
>
> I used jOOQ In the past with code generation and I understand the benefits
> especially in terms of type information and type safety.
>

Sure, I knew you were aware of it, I just point this out at every occasion,
given there are other readers.


> In terms of type safety, would it be possible to fail (exception) when
> there is no default mapping available?
>

You can implement a RecordListener that fails if a record isn't entirely
populated.  The RecordListener.loadEnd() event could help here. I don't
think this would be a good out of the box behaviour. There's no reason to
assume that everyone always uses 1:1 POJO to Record mappings.


> And would there be a way to implement a RecordUnmapper where one only
> needs to map fields that do not match automatically?
>

You can implement one that delegates to the DefaultRecordUnmapper, and then
does some extra work on the resulting Record.


> Or would it be better to use another tool - like MapStruct - to map from
> Continent POJO to ContinentRecord?
>

Well, not sure what "better" means in this context. I can't recommend other
tools because I don't know them. You'll exchange one set of problems for
another, as I'd expect :)

I hope this helps,
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO7Kr1duM_cyv8yRTaKC-E8-gnfw10bgiWncYjz7UjTQTQ%40mail.gmail.com.

Reply via email to