I just can’t figure out how to optimize this into one query in HQL. Currently, I have the following 2 HQL queries. They both return the results that I want and I can merge those results in C# and do what I need to. However, there must be some way to just generate a single query to return all of the results. Everything I’ve tried so far either just generates an error or gives me the intersection of the 2 result sets. I’m sure I’m just missing something small. Thanks.
SELECT u FROM UserImpl u INNER JOIN u.Friends f WHERE f.State = :state AND f.Gender = :gender
SELECT u FROM UserImpl u INNER JOIN u.Relatives r WHERE r.State = :state AND r.Gender = :gender
The following should work, I think: