Query q = getEntityManager().createQuery("Select x from QuotaTransferes x " + "where x.customer.customerId = :agentId" + " and " + "x.customer1.customerId = :customerId" + " and " + "x.quotaTransferesPK.transfereDate.equals(:date)");