@Test public void testFindAllActsByContract() { Contract contract = contractDAO.read((1L)); assertEquals(4, actDAO.findAllActsByContract(contract).size()); contract = contractDAO.read((2L)); assertEquals(3, actDAO.findAllActsByContract(contract).size()); }
@SuppressWarnings("unchecked") public Collection<Act> findAllActsByContract(Contract contract) { Query query = entityManager.createQuery("SELECT a FROM " + getEntityClass().getName() + " a" + " WHERE a.contract = :contract"); query.setHint(CACHEABLE_OPTION, "true"); query.setParameter("contract", contract); return (List<Act>)query.getResultList(); }
ActDAO extends AbstractJPADAO<Act, Long> { @SuppressWarnings("unchecked") public Collection<Act> findAllActsByContract(Contract contract) { Query query = entityManager.createQuery("SELECT a FROM " + getEntityClass().getName() + " a" + " WHERE a.contract = :contract"); query.setHint(CACHEABLE_OPTION, "true"); query.setParameter("contract", contract); return (List<Act>)query.getResultList(); } }
ActDAO extends AbstractJPADAO<Act, Long> { @SuppressWarnings("unchecked") public Collection<Act> findAllActsByContract(Contract contract) { Query query = entityManager.createQuery("SELECT a FROM " + getEntityClass().getName() + " a" + " WHERE a.contract = :contract"); query.setHint(CACHEABLE_OPTION, "true"); query.setParameter("contract", contract); return (List<Act>)query.getResultList(); } ActDAO(); }
ActDAO extends AbstractJPADAO<Act, Long> { @SuppressWarnings("unchecked") public Collection<Act> findAllActsByContract(Contract contract) { Query query = entityManager.createQuery("SELECT a FROM " + getEntityClass().getName() + " a" + " WHERE a.contract = :contract"); query.setHint(CACHEABLE_OPTION, "true"); query.setParameter("contract", contract); return (List<Act>)query.getResultList(); } ActDAO(); int findNumberOfAct(Contract contract); @SuppressWarnings("unchecked") Collection<Act> findAllActsByContract(Contract contract); @SuppressWarnings("unchecked") Collection<Act> findActsByContract(
            Contract contract,
            int nbOfActs,
            int sortDirection,
            ScopeEnum scopeEnum,
            boolean onlyCompleted); @SuppressWarnings("unchecked") Collection<Act> findRunningActsByContract(Contract contract); Act findActFromAudit(Long auditId); int findNumberOfActByPeriodAndIp(Contract contract, Date limitDate, String ip); int findNumberOfActByScope(Contract contract, Collection<ScopeEnum> scopes); }
ActDAO extends AbstractJPADAO<Act, Long> { @SuppressWarnings("unchecked") public Collection<Act> findAllActsByContract(Contract contract) { Query query = entityManager.createQuery("SELECT a FROM " + getEntityClass().getName() + " a" + " WHERE a.contract = :contract"); query.setHint(CACHEABLE_OPTION, "true"); query.setParameter("contract", contract); return (List<Act>)query.getResultList(); } ActDAO(); int findNumberOfAct(Contract contract); @SuppressWarnings("unchecked") Collection<Act> findAllActsByContract(Contract contract); @SuppressWarnings("unchecked") Collection<Act> findActsByContract(
            Contract contract,
            int nbOfActs,
            int sortDirection,
            ScopeEnum scopeEnum,
            boolean onlyCompleted); @SuppressWarnings("unchecked") Collection<Act> findRunningActsByContract(Contract contract); Act findActFromAudit(Long auditId); int findNumberOfActByPeriodAndIp(Contract contract, Date limitDate, String ip); int findNumberOfActByScope(Contract contract, Collection<ScopeEnum> scopes);  }