I saw the documentation regarding
but when i do that the code generator fails since it cannot find the class.
[ERROR] Failed to execute goal org.jooq:jooq-codegen-maven:3.12.1:generate
(default) on project jooq-model: Error running jOOQ code generation tool:
Error while exporting schema: Unable to resolve name
as strategy [org.hibernate.boot.model.naming.PhysicalNamingStrategy]:
Unable to load class
Could not load requested class :
This seems to be a dependency issue - a very unfortunate one at that.
We do some magic to work around some Maven limitations where project
dependencies are not automatically on the classpath of a plugin. We did
this such that users don't have to repeat adding the JDBC driver dependency
all the time. The relevant trick was implemented here: https://github.com/jOOQ/jOOQ/issues/2886
But in this particular case, it appears that transitive dependencies cannot
be looked up this way, for example both Hibernate and the JPA API are
I can get your project to compile and generate code using this patch:
This is very annoying, of course, and without significant maven-fu (who has
that) can only be achieved by randomly adding more dependencies until it
works. I tend to think that this is by design in Maven, but it may well be
that we're misunderstanding something, or that we could add another hack
like the one where we found JDBC drivers from the project classpath. In
fact, again, our workaround already managed to find jooq-meta-extensions
for you, but not its transitive dependencies.
Exposing H2 specific flags has been a recurring request in the past for
both the DDLDatabase and the JPADatabase, and we've rejected it based on
the fact that we do not really want to document / guarantee / or specify
any dependency on H2 in DDLDatabase or JPADatabase. The fact that we're
using H2 behind the scenes is an implementation detail that has brought us
quick wins - i.e. being able to do this kind of generation *at all* at the
cost of certain incompatibilities this may cause. The current
implementation is likely going to be replaced soon (hopefully 3.13) as
we're working on DDL simulator that mainly benefits the DDLDatabase, but
will also help improve some JPADatabase edge cases. See: https://github.com/jOOQ/jOOQ/projects/1
Note we've relaxed our stance on this a little bit by forwarding any
JPADatabase configuration properties starting with "hibernate." or "javax."
to Hibernate's MetadataSources settings. It is unlikely that we're going to
replace the Hibernate dependency in DDLDatabase any time soon, so this is
slightly different. As such, it might be possible to work around the
current limitations by passing a naming strategy to Hibernate, which might
yield even better results than using H2's flags: https://www.baeldung.com/hibernate-naming-strategy
Alternatively, JPADatabase is just a few lines of code - you could fork it
and maintain your own version that handles this, for now, until we solve
this problem more thoroughly using the DDL simulation approach.
I hope this helps,
On Tue, Sep 17, 2019 at 11:35 AM Jens Teglhus Møller <[hidden email]>
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to [hidden email].