List of usage examples for org.springframework.data.mongodb.core.query Query Query
public Query(CriteriaDefinition criteriaDefinition)
From source file:eu.trentorise.smartcampus.communicatorservice.storage.CommunicatorStorage.java
public Notification getObjectByIdAndApp(String id, String capp, Class<Notification> class1) throws NotFoundException { Criteria criteria = new Criteria(); criteria = criteria.and("id").is(id); if (capp != null && capp.compareTo("") != 0) { criteria.and("content.type").is(capp); }/* ww w. j a v a 2 s. c o m*/ criteria = criteria.and("deleted").is(false); List<Notification> x = find(Query.query(criteria), Notification.class); if (x.isEmpty()) throw new NotFoundException(); return x.get(FIRST); }