}
ParameterExpression<Date> pDate = cb.parameter(Date.class);
cq.where(cb.lessThanOrEqualTo(
imageContent.<Date> get("createAt"), pDate));
cq.orderBy(cb.desc(imageContent.get("createAt")));
TypedQuery<ImageContent> query = em.createQuery(cq);
query.setParameter(p, category);
query.setParameter(pDate, date);
query.setFirstResult(first);