MongoQueryTranslator extends
        AbstractQueryTranslator<DBObject, DBObject, DBObject> implements
        QueryTranslator<DBObject, DBObject, DBObject> { @Override protected <T> DBObject translate(NativeExpression e, Class<T> entityClass) { Class<?> expressionClass = e.getExpressionClass(); if (DBObject.class.isAssignableFrom(expressionClass)) { return (DBObject) e.getExpression(); } else { throw unsupported(e); } } MongoQueryTranslator(PropertyResolver propertyResolver); @Override DBObject eq(String fieldName, Object value); @Override DBObject ne(String fieldName, Object value); @Override DBObject lt(String fieldName, Object value); @Override DBObject lte(String fieldName, Object value); @Override DBObject gt(String fieldName, Object value); @Override DBObject gte(String fieldName, Object value); @Override DBObject between(String fieldName, Object from, Object to); @Override DBObject in(String fieldName, Object[] values); @Override DBObject notIn(String fieldName, Object[] values); @Override DBObject contains(String fieldName, Object[] values); @Override DBObject isNull(String fieldName); @Override DBObject notNull(String fieldName); @Override DBObject isEmpty(String fieldName); @Override DBObject notEmpty(String fieldName); @Override DBObject within(String fieldName,
            Point<N> center, Number distance); @Override DBObject and(DBObject... subqueries); @Override DBObject or(DBObject... subqueries); @Override DBObject order(String fieldName, Order o); @Override DBObject order(DBObject... orders); @Override DBObject translateProjection(Query<T, R> query);  }
@Test public void translate_NativeExpression_Criterion() { DBObject query = o("something", "or other"); NativeExpression e = new NativeExpression(DBObject.class, query); assertEquals(query, translator.translate(e, Void.class)); }
@Test(expected = UnsupportedOperationException.class) public void translate_NativeExpression_unsupported() { Integer query = 1; NativeExpression e = new NativeExpression(Integer.class, query); translator.translate(e, Void.class); }