Query q = old_ssn.createQuery("FROM CatalogForm c ORDER BY c.id ASC");
List catalogs = q.list();
for(int i=0;i<catalogs.size();i++){
CatalogForm cform = (CatalogForm)catalogs.get(i);
CatalogBean cbean = new CatalogBean();
cbean.setSite(site);
cbean.setCreateTime(new Date());
cbean.setDetail(cform.getDetail());
cbean.setName(cform.getName());
cbean.setArticleCount(0);
cbean.setSortOrder(cform.getOrder());
if(cform.getType()==CatalogForm.TYPE_OWNER)
cbean.setType(CatalogBean.TYPE_OWNER);
else
cbean.setType(CatalogBean.TYPE_GENERAL);
new_ssn.save(cbean);
catalogids.put(new Integer(cform.getId()), cbean);
System.out.println("Catalog: " + cform.getId() + " -> " + cbean.getId());
}
}