【发布时间】:2018-03-24 05:22:05
【问题描述】:
我有一个使用 application.yml 文件配置的 Spring Boot 应用程序。我还使用 import.sql 文件通过插入语句将测试数据加载到我的应用程序中。
我希望 import.sql 支持多行语句。
我使用 application.properties 文件Spring Mvc Hibernate Encoding/Multi-line import sql 找到了这个类似问题的答案
但是,我似乎无法将该答案应用于使用我的 application.yml 文件,我尝试如下操作但未成功
spring:
jpa:
show-sql: true
hibernate:
hbm2ddl:
import_files_sql_extractor:org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor
作为参考,我在这里https://docs.jboss.org/hibernate/orm/5.2/javadocs/org/hibernate/tool/hbm2ddl/ImportSqlCommandExtractor.html找到了此属性的文档
但我似乎仍然无法正确配置它。任何人都可以帮忙吗?谢谢
【问题讨论】:
标签: java spring hibernate spring-mvc spring-boot