当前位置:网站首页>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边栏推荐
- Redis (4) -- Talking about integer set
- Porphyrin based polyimide (ppbpis); Synthesis of crosslinked porphyrin based polyimides (ppbpi CRS) porphyrin products supplied by Qiyue biology
- Okhttp3 source code explanation (IV) cache strategy, disadvantages of Android mixed development
- Google Earth Engine(GEE) 02-基本了解和学习资源
- Qt基础教程:QString
- 5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent
- The difference between insert ignore and insert into
- Two models of OSPF planning: double tower Raider and dog tooth crisscross
- Redis series - redis startup, client day1-2
- 执行npm install -g serve时报错权限权限问题解决方案
猜你喜欢

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

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

Two models of OSPF planning: double tower Raider and dog tooth crisscross

数据中心灾难恢复的重要参考指标:RTO和RPO

QTreeWidget And QTableWidget

Niuniu looks at the cloud (greedy, hash, push formula) - the first session of Niuke winter vacation training camp

Teach you how to use the harmonyos local simulator

GMP model

Shengshi Haotong enterprise wechat sector creates a digital ecological community

Solution to the problem of multi application routing using thinkphp6.0
随机推荐
Children play games (greed, prefix and) - Niuke winter vacation training camp
Jemter stress test - basic requirements - [teaching]
Installation homebrew error summary
QT basics tutorial: qstring
Esp32-c3 introductory tutorial WiFi part ⑥ - WIFI intelligent distribution network based on serial port
Solution to the problem of multi application routing using thinkphp6.0
卡尔曼滤波器_Recursive Processing
Jemter stress test - visualization tool support - [installation]
Xiaosha's counting (bit operation, Combinatorial Mathematics) - Niuke
Apache inlong graduated as a top-level project with a million billion level data stream processing capability!
Yyds dry inventory Druid connection pool usage
What is Wi Fi 6 (802.11ax)? Why is Wi Fi 6 important?
[UVM foundation] UVM_ Driver member variable req definition
Cache usage
Take you three minutes to get started typescript
Attention mechanism yyds, AI editor finally bid farewell to P and destroyed the whole picture
Is it safe for individuals to buy stocks with compass software? How to buy stocks
ES cluster_ block_ exception read_ only_ allow_ Delete question
The long path of Xiao Sha (graph theory, Euler diagram)
5,10,15,20-tetraphenylporphyrin (TPP) and metal complexes fetpp/mntpp/cutpp/zntpp/nitpp/cotpp/pttpp/pdtpp/cdtpp supplied by Qiyue