Hibernate 如何在Broadleaf中覆盖AddressImpl
我需要从中的Hibernate 如何在Broadleaf中覆盖AddressImpl,hibernate,broadleaf-commerce,Hibernate,Broadleaf Commerce,我需要从中的邮政编码字段中删除nullable=“false”约束。我尝试使用以下内容创建orm.xml: <entity class="org.broadleafcommerce.profile.core.domain.AddressImpl"> <attribute-override name="postalCode"> <column name="POSTAL_CODE" nullable="true" /> <
邮政编码
字段中删除nullable=“false”
约束。我尝试使用以下内容创建orm.xml:
<entity class="org.broadleafcommerce.profile.core.domain.AddressImpl">
<attribute-override name="postalCode">
<column name="POSTAL_CODE" nullable="true" />
</attribute-override>
</entity>
没有运气。。。我努力不去创建一个全新的
BLC\U地址
表,因为这似乎是多余的。。。如何覆盖此列并删除该约束?经过多次尝试后,我能够解决此问题:
<?xml version="1.0"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
version="2.0">
<entity
name="AddressImpl"
class="org.broadleafcommerce.profile.core.domain.AddressImpl"
access="FIELD"
metadata-complete="false">
<!-- POSTAL_CODE should accept null values -->
<attribute-override name="postalCode">
<column name="POSTAL_CODE" nullable="true"/>
</attribute-override>
</entity>
</entity-mappings>