11.2.3.2.4. ネストされた条件
論理演算子の優先順位の変更は、ネスト化されたフィルター条件を使用して実行できます。論理演算子を使用すると、前述のように 2 つの単純な属性条件に接続できますが、同じクエリーファクトリーで作成された後続の複雑な条件で単純な属性条件に接続することもできます。
// match all books that have an author named "Manik" and their title contains
// "Data Grid" or their description contains "clustering"
Query query = queryFactory.from(Book.class)
.having("author.name").eq("Manik")
.and(queryFactory.having("title").like("%Data Grid%")
.or().having("description").like("%clustering%"))
.build();