2 * Created on 28.08.2004
4 * TODO To change the template for this generated file go to
5 * Window - Preferences - Java - Code Generation - Code and Comments
7 package org.codecoop.mir.core.dao.hibernate;
9 import net.sf.hibernate.Hibernate;
11 import org.codecoop.mir.core.dao.DatabaseFailure;
12 import org.codecoop.mir.core.dao.ICategoryDAO;
13 import org.codecoop.mir.core.model.Category;
18 * $Id: CategoryDAO.java,v 1.1 2004/11/06 16:20:48 idfx Exp $
20 public class CategoryDAO extends AbstractDAO implements ICategoryDAO {
23 * @see org.codecoop.mir.core.dao.hibernate.AbstractDAO#getReferenceClass()
25 protected Class getReferenceClass() {
26 return Category.class;
30 * @see org.codecoop.mir.core.dao.hibernate.AbstractDAO#initializeCollections(java.lang.Object)
32 protected void initializeCollections(Object o) throws DatabaseFailure {
33 if(o instanceof Category){
34 Category c = (Category)o;
36 Hibernate.initialize(c.getArticles());
37 Hibernate.initialize(c.getChildCategories());
38 } catch (Throwable e) {
39 throw new DatabaseFailure(e);