java - What are the possible values of spring.datasource.initialization-mode?
问题描述
I am configuring a database in Spring JPA and I want to know what the possible values are of spring.datasource.initialization-mode
. I found this page with common properties but it doesn't give all possible values. I'd expect there to be some documentation on all possible values of all properties you can set.
I am using the property in the props section in my applicationContext.xml
as properties for the entityManagerFactory
<util:properties id="props">
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQL82Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<prop key="hibernate.ddl-auto">create</prop>
<prop key="spring.jpa.show-sql">true</prop>
<prop key="spring.jpa.generate.ddl">true</prop>
<prop key="spring.jpa.hibernate.ddl-auto">create</prop>
<prop key="spring.datasource.initialization-mode">always</prop>
<prop key="spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation">true</prop>
</util:properties>
解决方案
When all else fails, you remember "use the source, Luke!". The values are given in the Javadoc of the enum DataSourceInitializationMode
. Values are always
, embedded
and never
.
推荐阅读
- ios - 在科尔多瓦 iOS 6.1.0 中找不到 CDVUserAgentUtil.h' 文件
- azure - 将 azure-iot-sdk-c 从 LTS_01_2021_Ref01 升级到 LTS_07_2021_Ref01 证书验证失败后
- c++ - 石头剪刀布有时会给出错误的结果
- python-poetry - 在 python-poetry 中找不到包,最多列出 9 个
- angular - 如何使用spring boot和angular为master detail crud编写spring boot后端删除操作
- python - 根据名称在 python 字典中查找一组值
- reactjs - 将单值状态更改为对象状态
- angular - Observable List Non-Changing on parent - @Ionic5/angular12 - @Input + Modal + 嵌套组件
- c# - 日期选择器的弹出窗口显示错误的年份
- python - 使用 for 循环检查函数中的参数是否满足使用 for 循环的同一函数中的另一个参数