# OneToOne(LAZY) links produce different queries by findOneById for similar entities

**URL:** <https://discourse.hibernate.org/t/onetoone-lazy-links-produce-different-queries-by-findonebyid-for-similar-entities/11505>\
**Category:** Hibernate ORM\
**Created:** [May 28, 2025, 9:18pm UTC](https://discourse.hibernate.org/t/onetoone-lazy-links-produce-different-queries-by-findonebyid-for-similar-entities/11505 "2025-05-28T21:18:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Logic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/simon_logic/32/3901_2.png) [@Simon\_Logic](https://discourse.hibernate.org/u/Simon_Logic)\
**Post date:** [May 28, 2025, 9:18pm UTC](https://discourse.hibernate.org/t/onetoone-lazy-links-produce-different-queries-by-findonebyid-for-similar-entities/11505/1 "2025-05-28T21:18:00Z")

</div>

Hibernate 6.6.16.  
Bytecode enhancing is on (dirty + lazy only).  
I have Deal and Participant entities with bidirectional @OneToOne(LAZY) fields. Deal has 3 such properties. Participant has 11.  
findOneById() produces different SQL queries:

1. for Participant it fetches only row from participant table (this is what i want)
2. for Deal it fetches row from deal table + all OneToOne relations by separate queries.

Why?

---

<div class="post-metadata">

**Author:** ![mbladel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbladel/32/2128_2.png) [@mbladel](https://discourse.hibernate.org/u/mbladel)\
**Post date:** [June 3, 2025, 10:34am UTC](https://discourse.hibernate.org/t/onetoone-lazy-links-produce-different-queries-by-findonebyid-for-similar-entities/11505/2 "2025-06-03T10:34:38Z")

</div>

Hard to say with this little information. Please share the full mappings of the entities involved.
