首页 > 其他 > 详细

hiberanate父子表不同继承

时间:2017-03-07 13:01:41      阅读:303      评论:0      收藏:0      [点我收藏+]

//父表子表分开定义

父表

@Inheritance(strategy = InheritanceType.JOINED)

子表

@PrimaryKeyJoinColumn(name="plateClusterId")

 

//父表子表公用一张表,以不同字段区分

父表

@Inheritance(strategy = InheritanceType.SINGLE_TABLE)

@DiscriminatorColumn(name = "clusterUsage", discriminatorType = DiscriminatorType.INTEGER)

子表

@DiscriminatorValue("4")

hiberanate父子表不同继承

原文:http://www.cnblogs.com/xuexinyan/p/6513907.html

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