Да, вы можете определить фильтр для модели:
@Entity
@Table(name="comments")
@FilterDef(name="commentFilter", parameters={
@ParamDef(name="private", type="boolean")
})
@Filters({
@Filter(name="commentFilter", condition=":private=isprivate")
})
public class Comments {
@Id
@Column(name="id")
private Integer id;
@Column(name="private")
private boolean private;
...
и для запроса
Session session = HibernateUtil.getSessionFactory().openSession();
System.out.println("--Enable Filter--");
Filter filter = session.enableFilter("commentFilter");
filter.setParameter("private",true);
session.beginTransaction();
List<Comments> results = session.createQuery("from Comments").list();