I have implemented HibernateLoopDataSource in which I have constructor, one without applied criteria and one with. It looks like following
HibernateLoopDataSource.java
//code trimmed
HibernateLoopDataSource(Session hibernate, Class<?> typeOfClass){
this.hibernate = hibernate;
this.typeOfClass = typeOfClass;
}
HibernateLoopDataSource(Session hibernate, Class<?> typeOfClass, AppliedCriteria appliedCriteria){
this.hibernate = hibernate;
this.typeOfClass = typeOfClass;
}
AppliedCriteria.java //looks like following
it is an interface and contains only one method
applyingCriteria(Criteria criteria);
and
GettingArticles.java
// code trimmed
public LoopDataSource getArticles(){
return new HibernateLoopDataSource(hibernate, Article.class, new AppliedCriteria(){
public void applyingCriteria(Criteria criteria){
criteria.add(Restrictions.eq("article.id", fullCommentPageListing.getArticle().getId()));}});}
However, when I try to initialize it doesn't report anything, however it loops without applying criteria. What may be the cause of this issue, I am stuck on it 2 hours, it may be some trivial, and I can't see it, 'cause I am working on this for 8 hours. Any help is appreciated.