我有一个由以下 xml 文件映射的表:
<hibernate-mapping auto-import="true" default-access="property"
default-cascade="none" default-lazy="true">
<class abstract="false" name="domain.CustomFlow"
table="CUSTOM_FLOW">
<id column="CUSTOM_FLOW_ID" name="id">
<generator class="native" />
</id>
<many-to-one name="customForm"
class="domain.CustomForm" fetch="select">
<column name="FORM_ID" not-null="true" />
</many-to-one>
<dynamic-component insert="true" name="customProperties"
optimistic-lock="true" unique="false" update="true">
</dynamic-component>
</class>
</hibernate-mapping>
我确实在运行时更新了 xml 映射,所以它看起来像:
<dynamic-component insert="true" name="customProperties" optimistic-lock="true" unique="false" update="true"><property column="testColumn" generated="never" lazy="false" name="testColumn" not-null="false" optimistic-lock="true" type="java.lang.String" unique="false"/></dynamic-component>
如何在运行时更新数据库架构。我正在使用休眠和弹簧?