Search in sources :

Example 41 with BooleanBuilder

use of com.querydsl.core.BooleanBuilder in project querydsl by querydsl.

the class BooleanOperationsTest method booleanBuilder1.

@Test
public void booleanBuilder1() {
    BooleanBuilder bb1 = new BooleanBuilder();
    bb1.and(cat.eq(cat));
    BooleanBuilder bb2 = new BooleanBuilder();
    bb2.or(cat.eq(cat));
    bb2.or(cat.eq(cat));
    assertToString("cat = cat and (cat = cat or cat = cat)", bb1.and(bb2));
}
Also used : BooleanBuilder(com.querydsl.core.BooleanBuilder) Test(org.junit.Test)

Aggregations

BooleanBuilder (com.querydsl.core.BooleanBuilder)41 Predicate (com.querydsl.core.types.Predicate)12 ArrayList (java.util.ArrayList)10 JPAQuery (com.querydsl.jpa.impl.JPAQuery)8 QJpaAlert (com.thinkbiganalytics.metadata.jpa.alerts.QJpaAlert)8 Sort (org.springframework.data.domain.Sort)8 List (java.util.List)7 QJpaOpsManagerFeed (com.thinkbiganalytics.metadata.jpa.feed.QJpaOpsManagerFeed)6 Map (java.util.Map)6 Pageable (org.springframework.data.domain.Pageable)6 Alert (com.thinkbiganalytics.alerts.api.Alert)5 Test (org.junit.Test)5 JpaAlert (com.thinkbiganalytics.metadata.jpa.alerts.JpaAlert)4 HashMap (java.util.HashMap)4 Collectors (java.util.stream.Collectors)4 EntityNotFoundException (javax.persistence.EntityNotFoundException)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 Service (org.springframework.stereotype.Service)4 Expression (com.querydsl.core.types.Expression)3 Projections (com.querydsl.core.types.Projections)3