Hello,
I'm struggeling to get a query run right. I have 2 entities (simplified)
class A { @Id @GeneratedValue private Long key; @OneToOne(mappedBy = "other", cascade = CascadeType.ALL) private B another } class B { @Id @GeneratedValue private Long key; private int counter; @OneToOne private A other; }
so entity B is the owner. Now I persisted 2 entities of type A. In the first one, the member "another" is null... in the second
one "another" is set.
Now I want to query "select from A where another is null OR another.counter = 0"
What I expected to get where the 2 entities I inserted before. But I always get just the entity A were "another" is not null.
Could someone help where to find my mistake?!
Many thanks in advance,
Patrick