42

I've just added configuration for Hibernate to my application and IntelliJ Idea is complaining that this dialect is deprecated:

<property name="hibernate.dialect">
   org.hibernate.dialect.PostgreSQLDialect
</property> 

Does not seem to be a clear solution on the internet, any suggestions?

Shota
  • 6,910
  • 9
  • 37
  • 67

1 Answers1

69

You need to use org.hibernate.dialect.PostgreSQL82Dialect instead.

This is documented in PostgreSQLDialect Javadoc:

Deprecated.
use PostgreSQL82Dialect instead

Note however that you should use the dialect that best matches the PostgreSQL JDBC driver you are using (list here). For example, if you are using PostgreSQL 9.4 or later, use PostgreSQL94Dialect instead.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
  • 1
    I am a bit confused about it. I have postgres 10 (docker) and the PostgresSQL JDBC: 'org.postgresql:postgresql:42.2.8'. Can I easily use the last version of the dialect, meaning PostgreSQL10Dialect? – panza Apr 23 '20 at 21:12
  • note that this has been deprectated in hibernate 6.0 and it's actually the other way around now. Gotta love java – Riedler Dec 19 '22 at 19:13