Hi Jens,

Thank you very much for your message.

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

On Tue, Sep 17, 2019 at 11:35 AM Jens Teglhus Møller <[email protected]>
wrote:

> Hi
>
> I'm trying to do some kind of rapid schema evolution where I use JPA for
> schema development.
>
> I develop/test on H2 but will end up on mysql or perhaps postgres.
>
> It would be nice if the H2 database instantiated by the JPADatabase
> generator could be controlled so you could put H2 into compat mode <
> http://www.h2database.com/html/features.html#compatibility>.
>
> I checked the source <
> https://github.com/jOOQ/jOOQ/blob/ddc47a36c9302954d1cdff0e75b6a186389ac7b0/jOOQ-meta-extensions/src/main/java/org/jooq/meta/extensions/jpa/JPADatabase.java#L137>
> and currently the jdbc url is hardcoded as:
>
>                 connection = new
> org.h2.Driver().connect("jdbc:h2:mem:jooq-meta-extensions-" +
> UUID.randomUUID(), info);
>
> So either you could overide first argument to connect completely with a
> property or a property that is appended (so you can give a value like:
> ;MODE=MySQL;DATABASE_TO_LOWER=TRUE).
>
> Does it make sense? I can probably create a PR for this but would like to
> know which approach you would prefer.
>
> Best regards Jens
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/1790eb64-9f2f-449a-89e2-a7a45d3ebda5%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/1790eb64-9f2f-449a-89e2-a7a45d3ebda5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO5G9i63AhDG-kmS1n69UZjHwzEB-apdUrqou2UJXR69Tw%40mail.gmail.com.

Reply via email to