CriteriaBuilder criteriaBuilder = em
.getCriteriaBuilder();
CriteriaQuery<FreeChair> query = criteriaBuilder
.createQuery(FreeChair.class);
Root<FreeChair> auth = query.from(FreeChair.class);
FreeChair FreeChair = null;
query.select(auth).where(
criteriaBuilder.equal(auth.get("name"), name));
List<FreeChair> result = em.createQuery(query)
.getResultList();
if (result.isEmpty())