It's a chicken-and-egg problem only because you're trying to trick Maven
into doing something it wasn't designed for. You simply cannot (should
not?) reference types that are not really available yet in a code generator.
Perhaps you did find somewhat of a loophole and it does work to some
extent, but there's risk of your solution breaking again.
This is the reason why the jOOQ code generator never references any types
but only type names (e.g. what you put in forcedType / userType). This way,
it doesn't actually have to *know* the Class reference until the generated
code is compiled *after generation*
It seems to me that you can easily solve your problem by adhering to a
naming convention:
new ForcedType()
.withName(Visibility.class.getCanonicalName())
.withExpression("visibility")
.withUserType(Visibility.class.getCanonicalName())
.withConverter("com.example." + Visibility.class.getSimpleName() +
"Converter")
Hope this helps,
Lukas
2017-02-28 6:53 GMT+01:00 <[email protected]>:
> Hm.
>
> Our beans live in a module by themselves.
>
> I want to bind the enums in that module to use our existing enum type.
>
> In order to reference the generated jooq enum types, the converters need
> to be in the same module as the generated code.
> That is, they cannot reference the generated enum until it exists, and the
> generator won't compile without the converter types properly resolved.
>
> Unless it is possible to generate the enum types first in one module, then
> reference them in a later module which registers converters, I am in a bit
> of chicken-and-egg problem.
> That or I don't understand how to tell jooq to just straight up use my
> enum entirely and not own it's own copy (which I can't reference in
> converter until it exists, and can't generate without my converters on
> classpath).
>
> --
> 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.
>
--
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.