我正在开发一个Spring JPA应用程序,使用MySQL作为数据库.我确保加载了所有spring jpa库、hibernate和mysql连接器java.
我正在运行一个mysql 5实例.这是我申请的摘录.属性文件:
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
spring.datasource.url=jdbc:mysql://localhost/mydatabase
spring.datasource.username=myuser
spring.datasource.password=SUPERSECRET
spring.datasource.driverClassName=com.mysql.jdbc.Driver
执行集成测试时,spring StartSP正常运行,但无法创建hibernate SessionFactory,但以下情况除外:
org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
我认为我的方言应该是MySQL5方言,我还try 了一个显式声明InnoDB的选项,以及两个不表示版本5的方言选项.但我总是以同样的"没有JDBC类型的方言映射:1111"消息结束.
我设置的属性是否错误?我找不到关于这些房产名称的官方文件,但在这个答案中找到了一个提示:https://stackoverflow.com/a/25941616/1735497
期待您的回答,谢谢!
顺便说一句,应用程序已经在使用spring boot.