当前位置:网站首页>Detach an entity from jpa/ejb3 persistence context
Detach an entity from jpa/ejb3 persistence context
2022-06-26 07:36:00 【French red wine sweet】
problem :
What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Separation pass EntityManager Get specific JPA Entity Bean What's the easiest way to do it .Alternatively, could I have a query return detached objects in the first place so they would essentially act as 'read only'? perhaps , Can I first have the query return a separate object , So that they basically act as “ read-only ”?
The reason why I want to do this is becuase I want to modify the data within the bean - with in my application only, but not ever have it persisted to the database. The reason I want to do this is because I want to modify bean Data in - Use only in my application , But it is never persisted to the database .In my program, I eventually have to call flush() on the EntityManager, which would persist all changes from attached entities to the underyling database, but I want to exclude specific objects. In my program , I finally have to EntityManager On the call flush(), This saves all changes from the attached entity to the underlying database , But I want to exclude certain objects .
Solution :
Reference resources : https://stackoom.com/en/question/8BC边栏推荐
- Excel中Unicode如何转换为汉字
- 执行npm install -g serve时报错权限权限问题解决方案
- Es performance tuning and other features
- php array_ Merge details
- Es string type (text vs keyword) selection
- Kalman filter_ Recursive Processing
- Jemter stress test - Basic request - [teaching]
- Jmeter压力测试-Web代理本地接口测试【教学篇】
- Cache usage
- Summary of domestic database examination data (continuously updated)
猜你喜欢

Request&Response

Jmeter压力测试-Web代理本地接口测试【教学篇】

Redis series - redis startup, client day1-2

How MySQL implements the RC transaction isolation level

缓存使用

Crosslinked porphyrin based polyimide ppbpi-2, ppbpi-1-cr and ppbpi-2-cr; Porous porphyrin based hyperbranched polyimide (ppbpi-1, ppbpi-2) supplied by Qiyue

Cache usage

B站增量数据湖探索与实践

C#实现给DevExpress中GridView表格指定列添加进度条显示效果——代码实现方式

The "big grievances" in the workplace are not only physically tired, but also mentally emptied
随机推荐
[North Asia data recovery] a server data recovery method in which the partitions in the RAID5 array are formatted due to the misoperation of the NTFS file system
Excel中Unicode如何转换为汉字
Exit of shell internal value command
[UVM practice] Chapter 3: UVM Fundamentals (3) field automation mechanism
Crosslinked metalloporphyrin based polyimide ppbpi-h) PPBP Mn; PBP-Fe; PPBPI-Fe-CR; Ppbpi Mn CR product - supplied by Qiyue
Tsinghua Yaoban chendanqi won Sloan award! He is a classmate with last year's winner Ma Tengyu. His doctoral thesis is one of the hottest in the past decade
JS event loop mechanism
Redis(4)----浅谈整数集合
Item2 installation configuration and environment failure solution
卡尔曼滤波器_Recursive Processing
Redis series - redis startup, client day1-2
Apache InLong毕业成为顶级项目,具备百万亿级数据流处理能力!
SQL
Yyds dry inventory Druid connection pool usage
Children play games (greed, prefix and) - Niuke winter vacation training camp
$a && $b = $c what???
Teach you how to use the harmonyos local simulator
Exploration and practice of incremental data Lake in station B
What is Wi Fi 6 (802.11ax)? Why is Wi Fi 6 important?
Okhttp3 source code explanation (IV) cache strategy, disadvantages of Android mixed development