package auction.dao.hibernate;
import auction.dao.CategoryDAO;
import auction.model.Category;
import org.hibernate.criterion.Expression;
import java.util.Collection;
/**
* Hibernate-specific implementation of the CategoryDAO
* non-CRUD data access object.
*
* @author Christian Bauer
*/
public class CategoryDAOHibernate
extends GenericHibernateDAO
implements CategoryDAO {
public Collection findAll(boolean onlyRootCategories) {
if (onlyRootCategories)
return findByCriteria( Expression.isNull("parent") );
else
return findAll();
}
}