Hi Joseph,

Of course you could run multiple generations with different prefixes each
time. Just create a new configuration for each generation.

Please note that all these classes are just XJC-generated classes from the
code generation configuration XSD:
https://www.jooq.org/xsd/jooq-codegen-3.9.2.xsd

There's no way to configure a strategy like new
PrefixGenerator("somePrefix") in XML, so there's also no such way in the
programmatic configuration. You could work around this issue by passing
some System.setProperty() or some global variable, or whatever.

Another option would be to use the matcher strategies, where you can
specify regular expressions. Perhaps that's easier for prefixing class
names:
https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy

I hope this helps,
Lukas

2017-05-03 9:33 GMT+02:00 <[email protected]>:

> Hi Lukas
>
> Thanks :) This helps... a bit!
>
> Indeed, I would like to run multiple generations with different prefix
> each time.
>
> This could be for example something like:
> Generator.withStrategy(new Strategy().with(new
> PrefixGenerator("somePrefix"))
>
> Is something similar possible? I guess I could use some static field
> somewhere, but I would be sad to have to do so ;)
>
> thanks again
> joseph
>
> On Tuesday, May 2, 2017 at 11:06:03 PM UTC+2, Lukas Eder wrote:
>>
>> Hi Joseph,
>>
>> The strategy is configured in Generator.withStrategy(new
>> Strategy().withName("fully.qualfied.class.name"))
>>
>> Hope this helps,
>> Lukas
>>
>>
>> 2017-05-01 22:48 GMT+02:00 <[email protected]>:
>>
>>> Hi Lukas
>>>
>>> thanks for the answer. Actually I just want to prefix everything with a
>>> version, so it looks like a perfect fit. I would like to make it from Java
>>> code, but I didn't manage to set it up, even the JPrefixGeneratorStrategy.
>>> To provide some context I provided the class I'm using for generation(
>>> https://github.com/cluelessjoe/jooq-flyway-typesafe-
>>> migration/blob/master/migrator/src/test/java/LatestModelGenerator.java).
>>> I tried giving the proper name, through withName, as well as
>>> withGenerate/withStrategy but nothing was working (or even compiling for
>>> the last two methods).
>>>
>>> How should I configure the JPrefixGeneratorStrategy (or mine) ?
>>>
>>> Thanks again
>>>
>>> On Monday, May 1, 2017 at 3:51:41 PM UTC+2, Lukas Eder wrote:
>>>>
>>>> ... Oh, I'm sorry, actually, the original discussion fits your request,
>>>> but then the discussion was hi-jacked. So here's my answer:
>>>>
>>>> The GeneratorStrategy won't allow you to produce your own Java code. It
>>>> only specifies what each generated Java object's name should be (e.g. class
>>>> names, package names, method names, setter names, getter names, attribute
>>>> names, etc.)
>>>>
>>>> If you want to produce your own custom Java code, you have two options:
>>>>
>>>> - Override the JavaGenerator and implement your own (parts).
>>>> - Override the JavaGenerator's custom code section methods:
>>>> https://www.jooq.org/doc/latest/manual/code-generation/codeg
>>>> en-custom-code
>>>>
>>>> Let me know if you need any help with those.
>>>> Cheers,
>>>> Lukas
>>>>
>>>> 2017-05-01 15:47 GMT+02:00 Lukas Eder <[email protected]>:
>>>>
>>>>> Hi Joseph,
>>>>>
>>>>> I'll start a new discussion thread for this, as I don't think it's
>>>>> related to the original discussion.
>>>>>
>>>>> Stay tuned
>>>>>
>>>>>
>>>>> 2017-05-01 11:28 GMT+02:00 <[email protected]>:
>>>>>
>>>>>> 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/LatestM
>>>>>> odelGenerator.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 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.
>>>
>>
>> --
> 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