Package com.mysema.query.types.expr

Examples of com.mysema.query.types.expr.BooleanExpression


  }

  @Override
  public BigDecimal sumResolvedAmountByAccountIdAndYearMonthAndSign(Integer accountId, YearMonth yearMonth, OperationSign sign) {

    BooleanExpression predicate = operation.account.id.eq(accountId).and(buildOperationSignPredicate(sign)).and(operation.status.id.eq(OperationStatus.RESOLVED));
    predicate = addOperationYearMonthExpression(predicate, operation, yearMonth);

    return from(operation).where(predicate).uniqueResult(operation.amount.sum());
  }
View Full Code Here


  }

  @Override
  public Page<Operation> findCardOperationsByAccountIdAndYearMonthAndStatus(Integer accountId, YearMonth yearMonth, OperationStatus status, Pageable pageable) {

    BooleanExpression predicate = operation.type.id.eq(OperationType.CARD).and(operation.account.id.eq(accountId)).and(operation.status.id.eq(status));
    predicate = addOperationYearMonthExpression(predicate, operation, yearMonth);

    JPQLQuery countQuery = from(operation).where(predicate);
    JPQLQuery query = applyPagination(from(operation).where(predicate).orderBy(operation.date.desc()), pageable);
View Full Code Here

  }

  @Override
  public BigDecimal sumCardAmountByAccountIdAndYearMonthAndSignAndStatus(Integer accountId, YearMonth yearMonth, OperationSign sign, OperationStatus status) {

    BooleanExpression predicate = operation.type.id.eq(OperationType.CARD).and(operation.account.id.eq(accountId)).and(buildOperationSignPredicate(sign))
        .and(operation.status.id.eq(status));
    predicate = addOperationYearMonthExpression(predicate, operation, yearMonth);

    return from(operation).where(predicate).uniqueResult(operation.amount.sum());
  }
View Full Code Here

  }

  @Override
  public Page<Operation> findCardOperationsByCardIdAndYearMonthAndStatus(Integer cardId, YearMonth yearMonth, OperationStatus status, Pageable pageable) {

    BooleanExpression predicate = operation.type.id.eq(OperationType.CARD).and(operation.card.id.eq(cardId)).and(operation.status.id.eq(status));
    predicate = addOperationYearMonthExpression(predicate, operation, yearMonth);

    JPQLQuery countQuery = from(operation).where(predicate);
    JPQLQuery query = applyPagination(from(operation).where(predicate).orderBy(operation.date.desc()), pageable);
View Full Code Here

  }

  @Override
  public BigDecimal sumCardAmountByCardIdAndYearMonthAndSignAndStatus(Integer cardId, YearMonth yearMonth, OperationSign sign, OperationStatus status) {

    BooleanExpression predicate = operation.type.id.eq(OperationType.CARD).and(operation.card.id.eq(cardId)).and(buildOperationSignPredicate(sign))
        .and(operation.status.id.eq(status));
    predicate = addOperationYearMonthExpression(predicate, operation, yearMonth);

    return from(operation).where(predicate).uniqueResult(operation.amount.sum());
  }
View Full Code Here

  }

  @Override
  public Page<Operation> findTransferByAccountId(Integer accountId, Pageable pageable) {

    BooleanExpression predicate = operation.type.id.eq(OperationType.TRANSFER).and(operation.account.id.eq(accountId));

    JPQLQuery countQuery = from(operation).where(predicate);
    JPQLQuery query = applyPagination(from(operation).where(predicate).orderBy(operation.date.desc()), pageable);

    return buildPage(countQuery, query, pageable);
View Full Code Here

        assertTrue(query().where(user.emailAddress.eq("bobby@example.com")).notExists());
    }

    @Test
    public void Count() {
        BooleanExpression filter = user.emailAddress.eq("bob@example.com");
        assertEquals(1, query().where(filter).count());
    }
View Full Code Here

        assertEquals(1, query().where(filter).count());
    }

    @Test
    public void UniqueResult() {
        BooleanExpression filter = user.emailAddress.eq("bob@example.com");
        User u = query().where(filter).uniqueResult();
        assertNotNull(u);
        assertEquals("bob@example.com", u.getEmailAddress());
    }
View Full Code Here

        assertEquals("bob@example.com", u.getEmailAddress());
    }

    @Test
    public void List() {
        BooleanExpression filter = user.emailAddress.eq("bob@example.com");
        List<User> list = query().where(filter).list();
        assertEquals(1, list.size());
        User u = query().where(filter).uniqueResult();
        assertEquals(u, list.get(0));
    }
View Full Code Here

        assertNotNull(query().where(user.middleName.eq("X")).singleResult());
    }

    @Test
    public void Ordering() {
        BooleanExpression filter = user.middleName.eq("X");
        // asc
        List<String> asc = getFirstNames(query().where(filter).orderBy(
                user.firstName.asc()).list());
        assertEquals(Arrays.asList("Anton", "Barbara", "John", "Robert"), asc);
View Full Code Here

TOP

Related Classes of com.mysema.query.types.expr.BooleanExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.