public static List<Task> findTodoInvolving(String user) { return find.fetch("project") .where() .eq("done", false) .eq("project.members.email", user) .findList(); }
/** * Return a page of jobs * * @param page Page to display * @param pageSize Number of computers per page * @param sortBy Computer property used for sorting * @param order Sort order (either or asc or desc) * @param filter Filter applied on the name column */ public static Page<JobOffer> getSortedJobPage( String userEmail, int page, int pageSize, String sortBy, String order, String filter) { return find.where() .eq("applicant.email", userEmail) .ilike("name", "%" + filter + "%") .orderBy(sortBy + " " + order) .fetch("company") .findPagingList(pageSize) .getPage(page); }
// Busca por Usuário public List<Messages> findByUser(User user) { return find.where().eq("user", user).findList(); }
// Listando todas as mensagens public List<Messages> findAll() { return find.all(); }
public static List<ActivityToDo> findInvolving(String user) { return find.where().eq("members.email", user).findList(); }
public static boolean isOwner(Long jobId, String username) { return find.where().eq("applicant.email", username).eq("id", jobId).findRowCount() > 0; }
/** Get Job offers recorded by A User */ public static List<JobOffer> getjobOffersFromUser(String userEmail) { return find.where().eq("applicant.email", userEmail).findList(); }
public static List<Boulder> getBouldersByCrag(String crag) { return find.where().eq("crag.cragName", crag).findList(); }
public static List<Boulder> findBouldersNeverSent() { return find.where().eq("sent", false).findList(); }
public static List<Boulder> findAll() { return find.all(); }
public static List<Boulder> findAllSent() { return find.where().eq("sent", true).findList(); }
public static List<Boulder> findBoulderSentBy(String climber) { return find.where().eq("haveSent.username", climber).findList(); }
/** * Query helper for entity Geonames with country String and zip String * * @param country 2 letter iso country code * @param zip Zip code (or partial) */ public static List<Geonames> findByCountryZip(String country, String zip) { return find.where().eq("country", country).like("zip", zip + "%").findList(); }
public static List<Project> findInvolving(String user) { return find.where().eq("members.email", user).findList(); }
public static List<CacheClassifier> findByGroup(Long id) { return find.where().eq("group", Group.findById(id)).orderBy("position").findList(); }
public static void deleteForGroup(Long id) { for (CacheClassifier gpm : findByGroup(id)) // gpm.delete(); find.ref(gpm.id).delete(); }