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:
asmhatre
2026-11-14 01:34:34 +05:30
co-authored by Claude Sonnet 5.5
commit 453fad0ee7
29 changed files with 1109 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
createEntityAgent() returns: org.hibernate.internal.StatelessSessionImpl
instanceof org.hibernate.StatelessSession: true
upsert(theme=dark) on an existing row, upsert(language=en) on a new row (2 statements)
merge into setting as t using (select cast(? as varchar(255)) name,cast(? as varchar(255)) val) as s on (t.name=s.name) when not matched then insert (name,val) values (s.name,s.val) when matched then update set val=s.val
merge into setting as t using (select cast(? as varchar(255)) name,cast(? as varchar(255)) val) as s on (t.name=s.name) when not matched then insert (name,val) values (s.name,s.val) when matched then update set val=s.val
theme -> dark
language -> en
insert() with an existing primary key -> jakarta.persistence.EntityExistsException
find() after delete() -> null