I have been facing this weird exception while trying to persist some values into a table using Hibernate in a Java application. However this exception occurs only for one parti
We had a Spring Data / JPA application and this error started happening after upgrading to Postgres 10.6 (from 10).
Our solution was as follows, in our JPA configuration class: note the new commented line,
props.put("hibernate.hbm2ddl.auto", "none"); //POSTGRES 10 --> 10.6 migration
Class:
@Configuration
@EnableJpaRepositories(basePackages = "app.dao")
@ComponentScan(basePackages = { "app.service" })
@EnableTransactionManagement
public class JpaConfig {
@Autowired
DataSource dataSource;
@Bean
public Map jpaProperties() {
Map props = new HashMap();
props.put("hibernate.dialect", PostgreSQL95Dialect.class.getName());
props.put("hibernate.hbm2ddl.auto", "none"); //POSTGRES 10 --> 10.6 migration.
return props;
}