- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
[Core]1 详解Hibernate下对象状态和Session接口
A、Session接口public interface Session extends Serializableorg.hibernate.SessionThe main runtime interface between a Java application and Hibernate. This is the central API class abstracting the notion of a persistence service.它是java应用程序和hibernate之间主要的运行时接口。这个中心API类抽象了一个持久服务的概念。The lifecycle of a Session is bounded by the beginning and end of a logical transaction. (Long transactions might span several database transactions.)Session的生命周期由一个逻辑事务限制。(长的事务可能要跨度几个数据库事务)。The main function of the Session is to offer create, read and delete operations for instances of mapped entity classes. Instances may exist in one of three states:transient: never persistent, not associated with any Sessionpersistent: associated with a unique Sessiondetached: previously persistent, not associated with any SessionSession的主要功能是为一个映射实体类的实例提供创建,读取,删除操作。这个实例可以是下面三种状态中的一种:transient: 没有持久化,不和任何Session相关联。persistent: 和一个Session相关联。detached: 之前持久化过,但不和任何Session相关联。Transient instances may be made persistent by calling save(), persist() or saveOrUpdate(). Persistent instances may be made transient by calling delete(). Any instance returned by a get() or load() method is persistent. Detached instances may be made persistent by calling update(), saveOrUpdate(), lock() or replicate(). The state of a transient or detached instance may also be made persistent as a new persistent instance by calling merge().Transient(瞬时)实例可以通过save(), persist() or saveOrUpdate()来进行实例化。Persistent(持久)实例可以通过调用delete()来变成Transient(瞬时)实例。任何由get()或 load()方法返回的实例都是Persistent(持久)实例。Detached(托管)实例可通过调用update(), saveOrUpdate(), lock()或replicate()来变成Persistent(持久)实例。一个Transient(瞬时)或Detached(托管)实例的状态也可以通过调用merge()来变成Persistent(持久)状态。save() and persist() result in an SQL INSERT, delete() in an SQL DELETE and update() or merge() in an SQL UPDATE. Changes to persistent instances are detected at flush time and also result in an SQL UPDATE. saveOrUpdate() and replicate() result in either an INSERT or an UPDATE.save()和persist()的结果是INSERT SQL代码
您可能关注的文档
最近下载
- 《少年吸烟危害》课件.pptx VIP
- 浙大中控ECS-100控制系统介绍.ppt VIP
- (2025秋新版)苏教版三年级数学上册全册教案.docx
- Premiere Pro CC视频剪辑基础教程-全套PPT课件.pptx
- 浙大中控ECS-700系统概要.pdf VIP
- 雅安百图高新材料股份有限公司年产60吨球形六方氮化硼聚体项目环境影响报告表.docx VIP
- 大学生创新创业指导教学教案课程设计.pdf VIP
- 满分优秀作文——《科技浪潮,筑梦未来》.docx VIP
- 雅安百图高新材料股份有限公司年产60吨球形六方氮化硼聚体项目环境影响报告.pptx VIP
- 浙大中控ECS-700控制站硬件使用手册.pdf VIP
文档评论(0)