Add hibernate-jpa module: 40 runnable Hibernate 7 / JPA interview answers on PostgreSQL 16
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cfo2K4u4rF18QsPXPFnytf
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
read a lazy collection after the session closed -> org.hibernate.LazyInitializationException: Cannot lazily initialize collection of role 'lab.hibernate.model.Department.employees' with key '1' (no session)
|
||||
cure 1: fetch it inside the query -> 3 employees, 1 SQL statement
|
||||
cure 2: ask for exactly the columns you need -> [E11, E12, E13], 1 SQL statement
|
||||
Reference in New Issue
Block a user