Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the Hibernate dialect in SpringBoot?

I have a custom dialect to set for Hibernate in SpringBoot. The dialect is for Gemfire. The instructions (https://discuss.zendesk.com/hc/en-us/articles/201724017-Pivotal-GemFire-XD-Hibernate-Dialect) are for XML-based config. However, I am using SpringBoot and I cannot figure out how to set this property.

The dialect is "com.pivotal.gemfirexd.hibernate.GemFireXDDialect"

like image 850
Jason Avatar asked Jul 26 '16 04:07

Jason


People also ask

What is Hibernate dialect in spring boot?

Dialect in Hibernate – Dialect is a class and a bridge between Java JDBC types and SQL types, which contains mapping between java language data type and database datatype. Dialect allows Hibernate to generate SQL optimized for a particular relational database.

Where is Hibernate dialect set?

Hibernate can detect the dialect based on the configured JDBC connection, or you can provide it as a configuration parameter. You can set all this information in the persistence. xml or, if you're using Spring Data JPA, in the application. properties file.

How do I get Hibernate dialect?

All of the Hibernate dialects are available in the org. hibernate. dialect package. Following is the popular List of SQL Dialects in Hibernate.


2 Answers

In application.properties

spring.jpa.properties.hibernate.dialect = com.pivotal.gemfirexd.hibernate.GemFireXDDialect 
like image 97
Alex Fernandez Avatar answered Sep 22 '22 20:09

Alex Fernandez


You can use this approach as well:

spring.jpa.database-platform=com.pivotal.gemfirexd.hibernate.GemFireXDDialect 
like image 41
Errol Carrasco Avatar answered Sep 19 '22 20:09

Errol Carrasco