Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int getLiczbaUbezpieczonychKlientow(EntityManager em) throws
- Exception {
- Query liczbaUbezpieczonychKlientow = em.createQuery("" +
- "SELECT COUNT( DISTINCT x.id ) " + "FROM TbCustomerEntity x " +
- "JOIN TbInsuranceEntity y ON y.customerId=x.id " +
- "JOIN TbModelEntity z ON y.modelId=z.id " +
- "WHERE z.model =:nazwa " +
- "AND :data BETWEEN y.dateFrom AND y.dateTo");
- liczbaUbezpieczonychKlientow.setParameter("nazwa", nazwaSamochodu);
- liczbaUbezpieczonychKlientow.setParameter("data",
- Data);
- return (int) liczbaUbezpieczonychKlientow.getSingleResult();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement