首页 > 数据库 > mysql教程 > JPA复合主键源码案例

JPA复合主键源码案例

WBOY
发布: 2016-06-07 15:23:18
原创
1408 人浏览过

http://note.youdao.com/share/?id=9065b839f2d6b3f1b6310ad9bb92d3f6type=note @Entity@Table(name = RELEASE_INFO_ELEMENT)public class ReleaseInfoElement { @EmbeddedId private PK pk = new PK(); @Column(name = VALUE) private String value; public

http://note.youdao.com/share/?id=9065b839f2d6b3f1b6310ad9bb92d3f6&type=note

@Entity @Table(name = "RELEASE_INFO_ELEMENT") public class ReleaseInfoElement { @EmbeddedId private PK pk = new PK(); @Column(name = "VALUE") private String value; public Long getInfoId() { return pk.infoId; } public void setInfoId(Long infoId) { pk.infoId = infoId; } public Long getParamId() { return pk.paramId; } @Override public String toString() { return "ReleaseInfoElement [infoId=" + pk.infoId + ", paramId=" + pk.paramId + ", value=" + value + "]"; } public void setParamId(Long paramId) { pk.paramId = paramId; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } @Embeddable public static class PK implements Serializable { @Column(name = "INFO_ID") private Long infoId; @Column(name = "PARAM_ID") private Long paramId; public PK() { super(); } } }

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板