AbstractHibernateQueryTranslator extends
        AbstractQueryTranslator<Q, O, P> implements QueryTranslator<Q, O, P> { @Override protected <T, N extends Number & Comparable<N>> Q translate(Distance2dExpression<N> e, Class<T> entityClass) { Operator operator = e.getOperator(); String xFieldName = getPropertyResolver().resolveXField(e.getPropertyName(), entityClass); String yFieldName = getPropertyResolver().resolveYField(e.getPropertyName(), entityClass); if (Operator.WITHIN.equals(operator)) { Box<N> box = boxMaker.make(new Point<N>(e.getX(), e.getY()), e.getDistance()); return within(xFieldName, yFieldName, box); } else { throw unsupported(operator, UnaryExpression.class); } } AbstractHibernateQueryTranslator(Class<Q> queryClass,
            Class<O> orderClass, HibernatePropertyResolver propertyResolver,
            BoxMaker boxMaker,
            ContainsExpressionHandler<Q> containsExpressionHandler); BoxMaker getBoxMaker(); ContainsExpressionHandler<Q> getContainsExpressionHandler(); @Override Q within(String fieldName,
            Point<N> center, Number distance); abstract Q within(
            String xFieldName, String yFieldName, Box<N> box); @Override Q contains(String fieldName, Object[] values);  }
@Test(expected = UnsupportedOperationException.class) public void unexpected_Distance2dExpression() { translator.translate(new Distance2dExpression<Double>(Operator.EQUAL, property, x, y, distance), entityClass); }
@Test public void translate_NativeExpression() { String expression = "property & 4 > 0"; NativeExpression e = new NativeExpression(String.class, expression); assertEquals(expression, translator.translate(query(e))); }