Hibernate 8 + Jakarta Persistence 4: EntityAgent and stateless sessions demo
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7jUQrypvpE1ix1k7V
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
agent.find(missing) -> null
|
||||
agent.get(missing) -> EntityNotFoundException
|
||||
|
||||
EntityAgent, same id twice in one transaction:
|
||||
same instance? false
|
||||
SQL (2 statements)
|
||||
select b1_0.isbn,b1_0.price,b1_0.publisher_id,b1_0.title,b1_0.version,b1_0.views from book b1_0 where b1_0.isbn=?
|
||||
select b1_0.isbn,b1_0.price,b1_0.publisher_id,b1_0.title,b1_0.version,b1_0.views from book b1_0 where b1_0.isbn=?
|
||||
|
||||
EntityManager, same id twice in one transaction:
|
||||
same instance? true
|
||||
SQL (1 statement)
|
||||
select b1_0.isbn,b1_0.price,b1_0.publisher_id,b1_0.title,b1_0.version,b1_0.views from book b1_0 where b1_0.isbn=?
|
||||
|
||||
agent.getMultiple(3 ids) returned 3 books
|
||||
SQL (1 statement)
|
||||
select b1_0.isbn,b1_0.price,b1_0.publisher_id,b1_0.title,b1_0.version,b1_0.views from book b1_0 where b1_0.isbn in (?,?,?)
|
||||
Reference in New Issue
Block a user