That’s not how this works and it’s also not easy to add support for this. So if you really want to join against a NULL value, you will have to introduce a sentinel value for this purpose and use the sentinel value instead of NULL. To be honest, it does seem to me like this is something that you shouldn’t model in your entity model, but should rather query through JPQL/HQL: select e, r from Entity e left join RevenueModel r on e.id = r.id and r.partnerId is null
Thank you for your response Christian. The nulls are the sentinel value, and this is a legacy schema that we’re having to back into. Given that a second relationship is needed for revenueModelsForPartners (where partnerId is not null), we may have to workaround this by defining separate RevenueModel classes, each having different class-level @Where annotations (we found that relation-level @Where's don’t apply to the join). Any other suggestions besides adhoc hql?
In that case, I would recommend you introduce a generated column on the table of RevenueModel: partnerIdNonNull GENERATED ALWAYS AS (coalesce(partnerId,0)) VIRTUAL NOT NULL