@Test public void testDivMemberLiteral() throws ODataApplicationException { JPAArithmeticOperator operator = mock(JPAArithmeticOperatorImp.class); @SuppressWarnings("unchecked") Expression<Number> result = mock(Path.class); when(operator.getRight()).thenReturn(mock(JPALiteralOperator.class)); when(operator.getOperator()).thenReturn(BinaryOperatorKind.DIV); when(operator.getLeft(cb)).thenReturn(expressionLeft); when(operator.getRightAsNumber(cb)).thenReturn(5); when(cb.quot(expressionLeft, 5)).thenReturn(result); Expression<?> act = cut.convert(operator); assertEquals(result, act); }
public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } JPAOperationConverter(final CriteriaBuilder cb, final JPAODataDatabaseOperations converterExtension); }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } JPAOperationConverter(final CriteriaBuilder cb, final JPAODataDatabaseOperations converterExtension); final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator); @SuppressWarnings("unchecked") final Expression<T> convert(final JPAArithmeticOperator jpaOperator); final Expression<Boolean> convert(final JPABooleanOperatorImp jpaOperator); @SuppressWarnings({ "unchecked" }) final Expression<Boolean> convert(@SuppressWarnings("rawtypes") final JPAComparisonOperatorImp jpaOperator); @SuppressWarnings("unchecked") Expression<?> convert(final JPAMethodCall jpaFunction); final Expression<Boolean> convert(final JPAUnaryBooleanOperatorImp jpaOperator); }
JPAOperationConverter { public final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator) throws ODataApplicationException { if (jpaOperator.getAggregation() == JPAFilterAggregationType.COUNT) return cb.count(jpaOperator.getPath()); return dbConverter.convert(jpaOperator); } JPAOperationConverter(final CriteriaBuilder cb, final JPAODataDatabaseOperations converterExtension); final Expression<Long> convert(final JPAAggregationOperationImp jpaOperator); @SuppressWarnings("unchecked") final Expression<T> convert(final JPAArithmeticOperator jpaOperator); final Expression<Boolean> convert(final JPABooleanOperatorImp jpaOperator); @SuppressWarnings({ "unchecked" }) final Expression<Boolean> convert(@SuppressWarnings("rawtypes") final JPAComparisonOperatorImp jpaOperator); @SuppressWarnings("unchecked") Expression<?> convert(final JPAMethodCall jpaFunction); final Expression<Boolean> convert(final JPAUnaryBooleanOperatorImp jpaOperator);  }