Hi,
Given :
@Entity(name = "Inspiration") public class Inspiration implements Serializable { .... @ManyToOne(fetch = FetchType.EAGER) protected Atelier atelier; .... }
I have a query :
SELECT i FROM Inspiration i WHERE i.atelier.id = 3
When I run this query I get wrong results - I get Inspiration objects that have atelier object with id = 3 (correct) and atelier objects = null. To make this query right I must change it to :
SELECT i FROM Inspiration i WHERE i.atelier IS NOT NULL AND i.atelier.id = 3
Greetings,
Karol Borkowski