Category c = new Category();
List list = new ArrayList();
c.setSubcategories(list);
list.add( new Category() );
c.setName("root");
Serializable id = s.save(c);
s.flush();
s.connection().commit();
s.close();
s = openSession();
c = (Category) s.load(Category.class, id);