- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
hibernate外键注解(国外英文资料)
hibernate外键注解(国外英文资料)
The way to define a master key: there are three
1: make the component class, jujve@embeddable, and annotate the properties of the component as @id
2: annotate the properties of the component as @embeddedid
3: annotate the class as @idclass and annotate all attributes that belong to the primary key in the entity class as @id
The use of @idclass is described below
The @id is defined on the get method, @idclass (corresponding to the individual primary key class name.class)
Using the @ Id defined in this class to establish joint primary key of the class, as long as defined in the primary key class corresponding to the attribute, as well as get and set methods, and use the same names are defined
This is the Ejb3 standard
You can also use Hibernate specifically.
Define the original class level
@ the Entity
AssociationOverride (name = id. Channel, joinColumns = @joincolumn (name = chan_id))
@ EmbededId public TvMa id... This is the primary key class object
The primary key in the class
The @embeddable
@ ManyToOne
Public Chanel Chanel
Public String name;
@ ManyToOne
Public Presesenter presenter.
Map the association of entity beans
One-to-one: there is only the only one in the primary foreign key table
There are three cases
2: the primary key to another entity is associated with the foreign key.
3: keep the link between the two entities by associating a table (having to increase the unique constraint on the foreign key column)
One-to-one Shared primary key: use @primarykeyjoincolumn to define a one-to-one association, ensuring that the primary key id of the two entities is the same, and then in a class
Define the get method for another class and set @onetoone (CasadeType. ALL)
Two: use the foreign key column to make an entity connection
The physical class get method of the foreign key table is defined in the primary key class table
And then set
@ OneToOne (cascade = CascadeType. ALL)
The @joincolumn (name = password_fk) is the primary key column for for
您可能关注的文档
- 3 空间数据的处理 北京大学.ppt
- 2013继承教导岩土试题(国外英文资料).doc
- 2014年12月份测验混凝土结构基础道理第二次功课(国外英文资料).doc
- 2014 吉大《土质学与土力学》在线功课二及谜底(国外英文资料).doc
- 2013涟钢外协工招聘钳工试卷_-_谜底(国外英文资料).doc
- 2013钢筋混凝土试题1谜底(国外英文资料).doc
- 2014年9月份测验施工组织与治理第三次功课(国外英文资料).doc
- 2014年9月份测验桥梁工程第三次功课(国外英文资料).doc
- 2014年9月份测验桥梁工程第二次功课(国外英文资料).doc
- 2014年9月份测验钢结构第一次功课(国外英文资料).doc
最近下载
- 高考数学圆锥曲线常用二级结论.pdf VIP
- 住院患者跌倒护理风险评估与护理指导意见.pdf VIP
- 《放疗副作用及应对》课件.ppt VIP
- GB50209-2010建筑地面工程施工质量验收规范(新).pdf VIP
- 新苏教版六年级科学上册 第一单元《物质的变化》测试卷(A卷).docx VIP
- 新苏教版六年级科学上册第一单元《物质的变化》测试卷及答案.pdf VIP
- 标准图集-20S515-钢筋混凝土及砖砌排水检查井.pdf VIP
- 煤矿用防爆电气设备防爆检查标准-培训课件.pptx
- 半导体物理学(第8版)刘恩科课后习题答案解析.pdf
- 新媒体背景下信息技术的发展及其应用分析.pdf VIP
文档评论(0)