Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4H5ph3J7k2MJnRuVH
7 lines
453 B
Plaintext
7 lines
453 B
Plaintext
# JPA fetch defaults: @OneToMany is LAZY, @ManyToOne is EAGER
|
|
# Hibernate ORM 7.4.16.Final, H2, JDK 25
|
|
-- find(EagerEmployee) with @ManyToOne at its default
|
|
sql> select ee1_0.id,d1_0.id,d1_0.name,ee1_0.name from EagerEmployee ee1_0 left join EagerDepartment d1_0 on d1_0.id=ee1_0.dept_id where ee1_0.id=?
|
|
-- find(EagerDepartment): the @OneToMany collection is not loaded
|
|
sql> select ed1_0.id,ed1_0.name from EagerDepartment ed1_0 where ed1_0.id=?
|