public List<String> findProdFactoryDesc(String prodtype, String prodName) {
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<String> cq = cb.createQuery(String.class);
Root<Product> prt = cq.from(Product.class);
Root<Factory> fct =cq.from(Factory.class);
Predicate pType=cb.equal(prt.get("type"), prodtype);
Predicate pName=cb.equal(prt.get("name"),prodName);
Predicate prtAnd=cb.and(pType,pName);
Predicate facType=cb.equal(fct.get("prodType"), prodtype);
Predicate facName=cb.equal(fct.get("prodName"),prodName);
Predicate facAnd=cb.and(facType,facName);
Predicate prtFacAnd=cb.and(prtAnd,facAnd);
cq.where(prtFacAnd);
cq.multiselect(fct.get("ftyDesc")).distinct(true);
List<String> list = entityManager.createQuery(cq).getResultList();
return list;
}