设置休眠方言不适用于Spring和YML配置
问题描述:
这是我的配置:
spring.jpa:
hibernate:
ddl-auto: update
connection:
charset: utf8
useUnicode: true
properties.hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect
基于我在文档和SO中找到的内容,它应该可以工作,但是仍然使用MyISAM而不是InnoDB创建新表.
Based on what I found in docs and SO it should work but still new tables are create with MyISAM instead of InnoDB.
我的配置有什么问题?
答
设置方言的属性实际上是spring.jpa.properties.hibernate.dialect
The property for setting the dialect is actually spring.jpa.properties.hibernate.dialect
尝试一下:
spring.jpa:
hibernate:
connection:
charset: utf8
useUnicode: true
ddl-auto: update
properties.hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect