Hi Renato,

Thanks for your message. I think there had been a similar discussion in the
past, but I cannot seem to find it either. The rationale there was to
"protect" the content from other packages, where the generated code would
be package-visible only to the DAO package. Of course, Java 9 will solve
this modularity aspect much more nicely.

If you want to proceed generating non-public classes, here's what you could
do today:

- Use a GeneratorStrategy to make sure all generated code is in the same
package:
https://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy
- Use a post-processor to replace all "public class" strings by "class". If
you're using Maven, the com.google.code.maven-replacer-plugin:replacer
plugin is quite useful for that job

Instead of post-processing, of course, you could also patch the
JavaGenerator, but that might be more work and will break after upgrading.

I hope this helps,
Lukas

2017-07-19 23:05 GMT+02:00 Renato <[email protected]>:

> Hi guys,
>
> I am evaluating jOOQ for a new product so I am brand new to jOOQ. I have
> been looking around the source code, documentation and this group but could
> not find the information I need.
>
>
> I want to jOOQ to generate non-public (package access only) classes. My
> thinking is that I generate a package only class and then put other classes
> that access the Db on the same package making them the only classes that
> can access the db.
> I have done that with hibernate and it works really well.
>
> Is there a configuration option to do that? Can I accomplish that using a
> custom generator?
>
> Thanks,
>
> Renato
>
> --
> 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