`

hibernate 集合映射

阅读更多
<hibernate-mapping>   
    <class name="com.bjsxt.hibernate.CollectionMapping" table="t_collection_mapping">   
        <id name="id">   
            <generator class="native"/>   
        </id>   
        <property name="name"/>   
        <set name="setValues" table="t_set_values">   
            <key column="set_id"/>   
            <element type="string" column="set_value"/>   
        </set>   
        <list name="listValues" table="t_list_values">   
            <key column="list_id"/>   
            <list-index column="list_index"/>   
            <element type="string" column="list_value"/>   
        </list>   
        <array name="arrayValues" table="t_array_values">   
            <key column="array_id"/>   
            <list-index column="array_index"/>   
            <element type="string" column="array_value"/>   
        </array>         
        <map name="mapValues" table="t_map_values">   
            <key column="map_id"/>   
            <map-key type="string" column="map_key"/>   
            <element type="string" column="map_value"/>   
        </map>   
    </class>   
</hibernate-mapping>  

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics