Precautions when using components in the hibernate framework


I believe that the component function of hibernate has greatly improved the flexibility of hibernate, but after using Component for the first time in this dish, I encountered a problem of hating my father and wasted most of the time.
Let’s talk about the problem:
in xxx.hbm.xml Configure components in
<component name="address" class="Address">
           <property name="postCode" type="string" column="POSTCODE"></property>
            <property name="identityCode" type="string" column="IDENTITYCODE"></property>
            <property name="address" type="string" column="ADDRESS"></property>
</component>
I think it is foolproof, but can not parse mapping is reported as soon as it runs. .. The specific meaning is that the mapping cannot be parsed. Finally, I know that the value of the attribute class of the component must be written with the full name of the component class! ! orz
<component name="address" class=" org.csuft.test.

            <property name="identityCode" type="string" column="IDENTITYCODE"></property>
            <property name="address" type="string" column="ADDRESS"></property>
</component>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326711435&siteId=291194637