Hi Joseph,

I'm afraid, I'm not too happy to implement such a workaround here. Any
additional protected method that exposes some of these internals is just as
good as a user actually patching the logic completely.

Note: A code generator overhaul is scheduled for version 4.0...

Thanks,
Lukas

2017-05-04 8:40 GMT+02:00 Joseph P. <[email protected]>:

> Hi again Lukas
>
> To overcome the static nature of giving the class name, I thought of a way
> that you may agree with.
>
> Indeed, the GenerationTool.run() method could be splitted in many smaller
> methods. One could then over some hook for anyone or just make these
> methods protected so someone else could subclass GenerationTool to provide
> some specific behavior.
>
> For example this chunk of code:
>
> GeneratorStrategy strategy;
>
> Matchers matchers = g.getStrategy().getMatchers();
> if (matchers != null) {
>     strategy = new MatcherStrategy(matchers);
>
>     if (g.getStrategy().getName() != null) {
>         log.warn("WARNING: Matchers take precedence over custom strategy.
> Strategy ignored: " +
>             g.getStrategy().getName());
>         g.getStrategy().setName(null);
>     }
> }
> else {
>     Class<GeneratorStrategy> strategyClass = (Class<GeneratorStrategy>)
> (!isBlank(g.getStrategy().getName())
>         ? loadClass(trim(g.getStrategy().getName()))
>         : DefaultGeneratorStrategy.class);
>     strategy = strategyClass.newInstance();
> }
>
> generator.setStrategy(strategy);
>
> could easily be changed to something like:
> generator.setStrategy(determineStrategy(generator))
>
> Provided determineStrategy is at least protected, I would easily sneak in.
>
> What do you think of it?
>
> Cheers
> joseph
>
> [email protected]
>
> Le 1 mai 2017 11:28, <[email protected]> a écrit :
>
>> Hi
>>
>> I'm obviously late to the party, yet I've an issue with the generation
>> strategy; I've my own I would like to hook in through Java code (there
>> https://github.com/cluelessjoe/jooq-flyway-typesafe-
>> migration/blob/master/migrator/src/test/java/LatestModelGenerator.java),
>> but I don't find a way.
>>
>> How should I proceed?
>>
>> Thanks in advance
>>
>> best
>> joseph
>>
>> On Monday, April 8, 2013 at 1:13:18 PM UTC+2, Lukas Eder wrote:
>>>
>>> 2013/4/8 Durchholz, Joachim <[email protected]>:
>>> >> However. Extracting these things takes time.
>>> >> And then, concrete use-cases matter, too.
>>> >
>>> > I couldn't agree less!
>>> >
>>> >> Lots of ideas, so, yes, keep on coming with suggestions.
>>> >
>>> > Okay, will do.
>>> >
>>> >> And contributions, of course! :-)
>>> >
>>> > Heh. Jooq is already near the top end of the list of projects I'd like
>>> to contribute to.
>>> > Don't hold your breath tough, that list is crammed.
>>>
>>> Ideas, feedback and discussion are contribution, too. That's great!
>>> So, looking forward to the eventual code contribution! :-)
>>>
>>> Cheers
>>> Lukas
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "jOOQ User Group" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/jooq-user/NAOpCatRcjs/unsubscribe.
>> To unsubscribe from this group and all its topics, 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.
>

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