Hibernate settings for h2 postgresql mode

119 views
Skip to first unread message

PavelTurk

unread,
Dec 8, 2023, 8:45:05 AM12/8/23
to h2-da...@googlegroups.com
I want to use H2 in PostgreSQL mode + Hibernate 6. However, I am not sure about driver and dialect settings for Hibernate:

url - jdbc:h2:tcp://localhost/db;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH"
driver - org.h2.Driver
dialect - org.hibernate.dialect.H2Dialect

I was told to to use H2Dialect for such situation, but not(PostgreSQLDialect). However, I don't understand why.

When we work with Hibernate then Hibernate will generate SQL code and if we set PostgreSQL mode for H2 then
we need to configure Hibernate generate PosgreSQL SQL code, don't we?

Best regards, Pavel
Reply all
Reply to author
Forward
0 new messages