@Test public void testFindSuccessfulByTaxCalculation_returnsSuccessful() { TaxWebserviceCallResult successfulByTaxCalculation = taxWebserviceCallResultRepository.findSuccessfulByTaxCalculation(january); assertThat(successfulByTaxCalculation).isEqualTo(januaryTry2); }
public TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation) { TypedQuery<TaxWebserviceCallResult> byTaxCalculation = entityManager.createNamedQuery(TaxWebserviceCallResult.FIND_SUCCESSFUL_BY_TAXCALCULATION, TaxWebserviceCallResult.class); byTaxCalculation.setParameter("taxCalculationId", taxCalculation.getId()); byTaxCalculation.setMaxResults(1); try { return byTaxCalculation.getSingleResult(); } catch (NoResultException e) { return null; } }
TaxWebserviceCallResultRepository extends AbstractRepository<TaxWebserviceCallResult> { public TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation) { TypedQuery<TaxWebserviceCallResult> byTaxCalculation = entityManager.createNamedQuery(TaxWebserviceCallResult.FIND_SUCCESSFUL_BY_TAXCALCULATION, TaxWebserviceCallResult.class); byTaxCalculation.setParameter("taxCalculationId", taxCalculation.getId()); byTaxCalculation.setMaxResults(1); try { return byTaxCalculation.getSingleResult(); } catch (NoResultException e) { return null; } } }
TaxWebserviceCallResultRepository extends AbstractRepository<TaxWebserviceCallResult> { public TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation) { TypedQuery<TaxWebserviceCallResult> byTaxCalculation = entityManager.createNamedQuery(TaxWebserviceCallResult.FIND_SUCCESSFUL_BY_TAXCALCULATION, TaxWebserviceCallResult.class); byTaxCalculation.setParameter("taxCalculationId", taxCalculation.getId()); byTaxCalculation.setMaxResults(1); try { return byTaxCalculation.getSingleResult(); } catch (NoResultException e) { return null; } }  }
TaxWebserviceCallResultRepository extends AbstractRepository<TaxWebserviceCallResult> { public TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation) { TypedQuery<TaxWebserviceCallResult> byTaxCalculation = entityManager.createNamedQuery(TaxWebserviceCallResult.FIND_SUCCESSFUL_BY_TAXCALCULATION, TaxWebserviceCallResult.class); byTaxCalculation.setParameter("taxCalculationId", taxCalculation.getId()); byTaxCalculation.setMaxResults(1); try { return byTaxCalculation.getSingleResult(); } catch (NoResultException e) { return null; } }  List<TaxWebserviceCallResult> findByTaxCalculation(TaxCalculation taxCalculation); TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation); }
TaxWebserviceCallResultRepository extends AbstractRepository<TaxWebserviceCallResult> { public TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation) { TypedQuery<TaxWebserviceCallResult> byTaxCalculation = entityManager.createNamedQuery(TaxWebserviceCallResult.FIND_SUCCESSFUL_BY_TAXCALCULATION, TaxWebserviceCallResult.class); byTaxCalculation.setParameter("taxCalculationId", taxCalculation.getId()); byTaxCalculation.setMaxResults(1); try { return byTaxCalculation.getSingleResult(); } catch (NoResultException e) { return null; } }  List<TaxWebserviceCallResult> findByTaxCalculation(TaxCalculation taxCalculation); TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation);  }