Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate 如何在Broadleaf中覆盖AddressImpl_Hibernate_Broadleaf Commerce - Fatal编程技术网

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>