我已经在互联网上搜索了很多但是找不到让Spring Hibernate与SQlite一起工作的解决方案(例如:这回答https://stackoverflow.com/a/24233241/2028440告诉他们制作一个自定义的SQLite包并且它不理想,我&# 39; d期望将.jar文件作为SQL方言的Maven存储库的依赖项。)
我还在POM中尝试了这个jar库https://github.com/EnigmaBridge/hibernate4-sqlite-dialect:
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.16.1</version>
</dependency>
<dependency>
<groupId>com.enigmabridge</groupId>
<artifactId>hibernate4-sqlite-dialect.git</artifactId>
<version>0.1.0</version>
</dependency>
并在application.properties中:
spring.datasource.url = jdbc:sqlite:test.db
spring.datasource.driver-class-name = org.sqlite.JDBC
spring.jpa.properties.hibernate.dialect = com.enigmabridge.hibernate.dialect.SQLiteDialect
但是,从Spring boot hibernate运行Web应用程序时出现错误
Caused by:
org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [com.enigmabridge.hibernate.dialect.SQLiteDialect] as strategy [org.hibernate.dialect.Dialect]
at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:113) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveDefaultableStrategy(StrategySelectorImpl.java:162) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveDefaultableStrategy(StrategySelectorImpl.java:126) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
如果有人有任何建议,请帮助,谢谢!