4

I've got a class (representing a project) which maps another class (representing a user) through a many-to-one relationship. As users come and go I've made sure to set the not-found property to ignore on the relationship.

However, it appears that Hibernate still attempts to load the "missing" users by executing one extra SQL query for each of the projects where the not-found property should have set the relationship to null. That is, in cases where the associated user no long exist, I would except the not-found property to simple "nullify" that relationship. However, Hibernate attempts to fetch these relationships one by one.

Any idea what I might do wrong?

sbrattla
  • 5,274
  • 3
  • 39
  • 63

1 Answers1

4

have you disabled lazy loading and set fetchmnode to joins because Hibernate has to fetch them to decide if it should nullify it or not and it can not decide that only with an id

hazzik
  • 13,019
  • 9
  • 47
  • 86
Firo
  • 30,626
  • 4
  • 55
  • 94