首页 > Web开发 > 详细

hibernate 一对多单向xml配置方式

时间:2018-03-13 17:45:25      阅读:183      评论:0      收藏:0      [点我收藏+]

实体类:

public class Battery {
    private Integer id;//编号
    private Set<BatteryVoltage> voltageList =new HashSet<>(); 




public class BatteryVoltage {
    private Integer id;//ID
    private Integer number;//编号
    private Double voltage;  //电压
    private Integer equipmentID;//

 

xml:  

        <set name="voltageList" inverse="true" cascade="delete">
            <key column="equipmentID"/>
            <one-to-many class="xdemo.entity.BatteryVoltage"/>
         </set>

 

hibernate 一对多单向xml配置方式

原文:https://www.cnblogs.com/dianfu537/p/8559133.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!