public MorphiaQuery enableValidation() { mq.enableValidation(); return this; }
public <T extends Model> MorphiaQuery enableValidation() { q_.enableValidation(); return this; }
@Override public <T, V> Query<T> get(final Class<T> clazz, final Iterable<V> ids) { return find(clazz).disableValidation().filter(Mapper.ID_KEY + " in", ids).enableValidation(); }
/** * Find all instances by type in a different collection than what is mapped on the class given skipping some documents and returning a * fixed number of the remaining. * * @param collection The collection use when querying * @param clazz the class to use for mapping the results * @param property the document property to query against * @param value the value to check for * @param offset the number of results to skip * @param size the maximum number of results to return * @param validate if true, validate the query * @param <T> the type to query * @param <V> the type to filter value * @return the query */ public <T, V> Query<T> find(final String collection, final Class<T> clazz, final String property, final V value, final int offset, final int size, final boolean validate) { final Query<T> query = find(collection, clazz); if (!validate) { query.disableValidation(); } query.offset(offset); query.limit(size); return query.filter(property, value).enableValidation(); }
.disableValidation() .filter(Mapper.ID_KEY, idValue) .enableValidation() .filter(versionKeyName, oldVersion); final UpdateResults res = update(query, dbObj, new UpdateOptions()