Predicate condition = cb.equal(c.get("deleted"), "false");
Predicate subCondition = cb.equal(c.get("externalRoomType"), externalRoomType);
cq.where(condition, subCondition);
cq.distinct(asc);
if (asc){
cq.orderBy(cb.asc(c.get(orderby)));
} else {
cq.orderBy(cb.desc(c.get(orderby)));
}
TypedQuery<Rooms> q = session.createQuery(cq);
q.setFirstResult(start);