01: package auction.dao.hibernate;
02:
03: import auction.dao.CategoryDAO;
04: import auction.model.Category;
05: import org.hibernate.criterion.Expression;
06:
07: import java.util.Collection;
08:
09: public class CategoryDAOHibernate extends
10: GenericHibernateDAO<Category, Long> implements CategoryDAO {
11:
12: public Collection<Category> findAll(Boolean onlyRootCategories) {
13: if (onlyRootCategories)
14: return findByCriteria(Expression.isNull("parentCategory"));
15: else
16: return findAll();
17: }
18: }
|