Hi Lukas,

> A mapper for enums can be generated by jOOQ with the slightly adapted
> design you originally proposed. It will be useful to 80% of the users

I agree.

> A mapper for arbitrary custom types cannot be generated. You can still
> consider your custom enums to be custom types and define your custom,
> non-generated mappers though.

Good.
Flexibility here is good: use what the library provides, but for
advanced stuff there is a way.

> I prefer the Field. Or more specifically, the field's DataType. I can
> see the more advanced use-case for replacing the default mapper by any
> compatible mapper in the Settings.
>
> I'd like to avoid delegating initialisation of jOOQ's internals to
> client code. That can go terribly wrong. MyTable2.MyEnum is to be
> considered an immutable column reference. It shouldn't be possible to
> change its configured state like this. If mappers are referenced from
> a Field's DataType, however, loading the generated classes takes care
> of loading (and initialising) the generated mappers automatically.

I am not sure how you want to ensure that mappers get initialized
before the fields when dealing with custom types.

> Anyway, your idea and mine aren't contradictions...

No, I think we are on the same train of thought now, so I am going to
be less of a pain :)

Cheers,
-Christopher

Reply via email to