- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
大连交通大学2012届本科生毕业设计 (论文) 外文翻译
PAGE
PAGE 13
Writing Container-Managed Persistent Entity Beans
Container-Managed Fields
A container-managed persistent entity bean allows the container to handle some or all of its data access logic. Rather than coding JDBC or SQL/J operations in your bean class, your container implicitly performs all database operations behind the scenes.
With container-managed persistence, you must make some of your entity bean class’s fields public so that the container can set the fields when it performs database operations on behalf of your bean. The fields that you want to be persistent are called container-managed fields. You don’t have to worry about setting these fields—the EJB container will automatically manipulate them for you
behind the scenes when it performs storage operations.
One restriction of container-managed fields is that every field you want to be managed by the container must follow the rules for Java object serialization (we describe these rules in full in Appendix A). This means that primitive types such as doubles and Booleans, as well as serializable classes such as primary key classes or EJB handles to other entity beans, can be container-managed fields.
For example, the following is a snippet of code from our bank account entity bean class that we wrote in Chapter 8:
With container-managed persistence, the container can persist each of these fields for you behind the scenes. When saving your bean instance’s fields, the container is responsible for querying your bean instance for these field values. When loading data into your bean instance, the container sets these fields. This is possible because each of the fields is declared as public.
Of course, you still must inform the container about which fields it should manipulate. You specify this in your bean’s deployment descriptor. The EJB container will inspect the deployment descriptor to figure out which of your entity bean’s fields to manipulate.
Note that not all
您可能关注的文档
最近下载
- 九年级数学秋季开学第一课(北师大版).pptx
- 部编人教版八年级上册道德与法治全册新质教学课件(配2025年秋改版教材).pptx
- 第1讲 我爱你中国(第一课时)美丽中国是我家(课件)-《新时代中国特色社会主义思想学生读本(小学低年级)》.pptx VIP
- 大学毕业论文_外文文献及中文翻译-财务风险的重要性how important is financial risk.doc VIP
- 人美版(2024)一年级美术上册第一单元《1.1介绍我自己》教学设计.docx VIP
- 民警进幼儿园安全讲课.pptx VIP
- 2024全国职业院校技能大赛ZZ055导游服务赛项规程+赛题 (2).docx VIP
- 计算机网络基础 龚娟 第2章 数据通信基础.ppt VIP
- 沙田柚种植技术最新完整版本.pptx VIP
- DBJ52_T103-2021:模块化箱式房屋安装及验收技术标准.pdf VIP
文档评论(0)