首页
论坛
门户
空间
手机版
IXPUB
插件
收藏
设置
注册
登录
商店
搜索
培训
Wiki
Blog
归档
丛书
退出
ITPUB论坛
»
Java企业开发
» JPA中的几个概念
‹‹ 上一主题
|
下一主题 ››
43
4/5
‹‹
1
2
3
4
5
››
投票
交易
悬赏
活动
评价
|
打印
|
推荐
|
订阅
|
收藏
标题: JPA中的几个概念
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#31
使用道具
发表于 2008-7-6 11:56
Cascade settings are unidirectional. This means that it must be explicitly set on both sides
of a relationship if the same behavior is intended for both situations
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#32
使用道具
发表于 2008-7-6 12:14
In the Persisting an Entity section, we mentioned that the entity instance is ignored if it is
already persisted. This is true, but the entity manager will still honor the PERSIST cascade in this
situation.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#33
使用道具
发表于 2008-7-6 12:31
There are really only two
cases where cascading the remove() operation makes sense: one-to-one and one-to-many relationships
where there is a clear parent-child relationship.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#34
使用道具
发表于 2008-7-6 15:06
Occasionally it may be necessary to clear a persistence context of its managed entities. This is
usually required only for application-managed and extended persistence contexts that are
long-lived and have grown too large in size.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#35
使用道具
发表于 2008-7-6 15:10
All entity
instances managed by the persistence context become detached with their state left exactly as
it was when the clear() operation was invoked.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#36
使用道具
发表于 2008-7-6 15:28
That said, a flush of the persistence context could occur at any time if the persistence
provider deems it necessary. An example of this is when a query is about to be executed and it
depends on new or changed entities in the persistence context. Some providers will flush the
persistence context to ensure that the query incorporates all pending changes. A provider
might also flush the persistence context often if it uses an eager-write approach to entity updates.
Most persistence providers defer SQL generation to the last possible moment for performance
reasons, but this is not guaranteed.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#37
使用道具
发表于 2008-7-6 15:48
Any time a detached object that is the target of the one-to-one or many-to-one
relationship is encountered where the source entity is the owner, the flush will still proceed
because the act of persisting the owning entity does not depend on the target. The owning entity
has the foreign key column and needs to store only the primary key value of the target entity.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#38
使用道具
发表于 2008-7-6 16:34
There are two views on detachment. On one hand, it is a powerful tool that can be leveraged by
applications in order to work with remote applications or to support access to entity data long
after a transaction has ended. On the other hand, it can be a frustrating problem when the
domain model contains lots of lazy-loading attributes and clients using the detached entities
need to access this information.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#39
使用道具
发表于 2008-7-6 16:35
• When the transaction that a transaction-scoped persistence context is associated with
commits, all of the entities managed by the persistence context become detached.
• If an application-managed persistence context is closed, all of its managed entities
become detached.
• If a stateful session bean with an extended persistence context is removed, all of its
managed entities become detached.
• If the clear() method of an entity manager is used, it detaches all of the entities in the
persistence context managed by that entity manager.
• When transaction rollback occurs, it causes all entities in all persistence contexts associated
with the transaction to become detached.
• When an entity is serialized, the serialized form of the entity is detached from its
persistence context.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
Sky-Tiger
天王盖地虎
来自 Vancouver
精华贴数 39
个人空间
0
技术积分 157862 (3)
社区积分 45608 (13)
注册日期 2004-2-19
论坛徽章:231
#40
使用道具
发表于 2008-7-6 16:50
The argument to merge() does not become managed
as a result of the merge. A different managed entity (either a new instance or an existing managed
version already in the persistence context) is updated to match the argument, and then this
instance is returned from the merge() method.
__________________
-----孰能浊以静之徐清 孰能安以动之徐生-----
-----风来疏竹 风过而竹不留声;雁照寒塘 雁去而塘不留影; 故君子事来而心始现 事去而心随空----
----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5 研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者
43
4/5
‹‹
1
2
3
4
5
››
投票
交易
悬赏
活动
相关内容
ITPUB论坛
≡ 数据库技术 ≡
> Oracle数据库管理
> Oracle开发
> Oracle Developer Suite
> Oracle入门与认证
> Oracle专题深入讨论
> Oracle新技术/11g
> Oracle电子文档
> Oracle Application Server套件
> IBM数据库产品
> MS SQL Server
> Sybase管理与开发
> MySQL及其它开源数据库
> 内存数据库
> 数据仓库与数据挖掘
> 移动及嵌入式数据库
≡ 企业信息化 ≡
> ERP产品与实践
> CRM产品与实践
> HR产品与实践
> 物流
> 供应链
> 供应链建模与仿真
> 物流设备与系统工程
> 企业管理咨询
> 管理协同与办公自动化
> IT服务管理
> 数据中心建设
> ERP二次开发
> Oracle ERP
> EBS相关文档
> PeopleSoft与JDE
> SAP R/3
> SAP Business One开发与快速实施
> SAP财务及CRM
> SAP后勤及HR
> mySAP ERP
> 系统开发及跨应用设置
> SAP相关文档
> 国外其它ERP产品
> 国内ERP产品
≡ 开发技术 ≡
> Java入门与认证版
> Java web开发及框架技术
> Java企业开发
> ASP.NET【已迁移到微软开发技术论坛】
> .Net企业开发与应用【已迁移到微软开发技术论坛】
> WEB程序开发
> WEB 2.0技术
> 动态语言
> 移动与游戏开发
≡ 系统设计与项目管理 ≡
> 系统分析与UML
> 系统分析与UML精华区
> 项目管理
> 项目过程
> 软件测试
> 算法讨论与研究
≡ IBM软件技术园地 ≡
> IBM数据库产品
> Lotus
> Tivoli
> Websphere
> Rational
> 与SOA相关的IBM产品与技术
> IBM软件技术精英协会
> 软件技术精英活动专版
≡ 操作系统与硬件 ≡
> AIX及IBM产品【已迁移到IXPUB】
> HP-UX及HP产品【已迁移到IXPUB】
> Solaris及SUN产品【已迁移到IXPUB】
> Linux及其应用 【已迁移到IXPUB】
> 其它UNIX系统【已迁移到IXPUB】
> windows系统及微软相关产品 【已迁移到IXPUB】
> 存储设备与容灾技术 【已迁移到IXPUB】
> 服务器 【已迁移到IXPUB】
≡ 行业纵向讨论区 ≡
> IT业界评论与展望
> 政府与教育事业
> 中国政府信息主管联盟
> 电信行业
> 金融行业
> 医卫行业
> 制造行业
> 电力行业
> 信息安全与审计
≡ 会员交流 ≡
> IT职业生涯
> 招聘求职商务信息
> 旅游,驴友
> 汽车世界
> 外语角
> 数码摄影
> 你的故事我的歌
> 音乐推荐区
> 电子图书与IT文档资料
> 软件交流
> 软件交流精华区
≡ ITPUB产品与服务 ≡
> ITPUB地面活动专版
> BLOG天地
> WIKI世界
> 授权用户区
> 站务管理
≡ 微软开发技术 ≡
> 开发工具和语言
> .NET Framework 相关
> Visual Basic/VB.net
> Visual C#
> Visual C++/vc.net
> Visual Studio
> .NET软件架构与模式
> .NET开发辅助工具及框架
> Web开发
> ASP.NET与AJAX
> Web相关讨论(IIS等)
> Silverlight 技术
> Office开发
> Microsoft office system
> Office Business Application
> 微软企业级产品技术
> windows server
> SharePoint
> Exchange Server
> Biztalk
> 嵌入式及移动开发
> Windows Embedded 嵌入式技术
> Windows 移动设备
> 微软产品用户交流区
> .Net电子书籍&&书籍介绍
> .Net人才交流
技术积分榜
社区积分榜
徽章
电子杂志
会员
团队
统计
邮箱
游乐场
帮助
TOP
CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号
联系我们
法律顾问
控制面板首页
编辑个人资料
积分交易
公众用户组
好友列表
升级个人空间
基本概况
论坛排行
主题排行
发帖排行
积分排行
在线时间
管理团队
管理统计