public Collection<CustomerInquiry> getInquiriesByCustomer(String company) {
    TypedQuery<CustomerInquiry> query =
        entityManager.createQuery(JPQL_GET_ALL_CUSTOMER_INQUIRIES, CustomerInquiry.class);
    Collection<CustomerInquiry> allCustomerInquiries = query.getResultList();
    List<CustomerInquiry> customerInquiries = new ArrayList<CustomerInquiry>();

    for (CustomerInquiry ci : allCustomerInquiries) {
      if (ci.getCustomer().getName().equals(company)) {
        customerInquiries.add(ci);
      }
    }
    Collections.reverse(customerInquiries);
    return customerInquiries;
  }
 public void customizeNotification(CustomerInquiry customerInquiry, String amount, String unit) {
   int span = Integer.valueOf(amount);
   if (unit.equalsIgnoreCase("days")) {
     span = Integer.valueOf(amount) * 24;
   }
   CustomerInquiry ci =
       getCustomerInquiry(
           customerInquiry.getCustomer().getName(),
           customerInquiry.getInquiry().getType(),
           customerInquiry.getSubject(),
           customerInquiry.getResponse());
   ci.setNotificationSpan(span);
   entityManager.persist(ci);
   entityManager.flush();
 }
 public void updateLeadStatus(CustomerInquiry customerInquiry, String status) {
   customerInquiry.setStatus(CustomerInquiry.Status.valueOf(status));
   entityManager.merge(customerInquiry);
   entityManager.flush();
 }