EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
CriteriaBuilder cb = session.getCriteriaBuilder();
CriteriaQuery<Users> cq = cb.createQuery(Users.class);
Root<Users> c = cq.from(Users.class);
Predicate condition = cb.equal(c.get("deleted"), "false");
Predicate subCondition = cb.equal(c.get("login"), login);
cq.where(condition, subCondition);
TypedQuery<Users> q = session.createQuery(cq);