protected FieldCriteria(final QueryImpl<?> query, final String fieldName, final FilterOperator op, final Object value,
final boolean validateNames, final boolean validateTypes, final boolean not) {
//validate might modify prop string to translate java field name to db field name
final StringBuilder sb = new StringBuilder(fieldName);
final MappedField mf = validateQuery(query.getEntityClass(),
query.getDatastore().getMapper(),
sb,
op,
value,
validateNames,
validateTypes);
final Mapper mapper = query.getDatastore().getMapper();
MappedClass mc = null;
try {
if (value != null && !ReflectionUtils.isPropertyType(value.getClass())
&& !ReflectionUtils.implementsInterface(value.getClass(), Iterable.class)) {
if (mf != null && !mf.isTypeMongoCompatible()) {
mc = mapper.getMappedClass((mf.isSingleValue()) ? mf.getType() : mf.getSubClass());
} else {
mc = mapper.getMappedClass(value);
}
}
} catch (Exception e) {