資源簡介
很好的OA系統項目完整源碼,附帶數據庫腳本
可以導入myeclipse里根據自己需求再修改

代碼片段和文件信息
package?com.common;
import?java.util.HashMap;
import?java.util.List;
import?org.hibernate.HibernateException;
import?org.hibernate.Query;
import?org.hibernate.Session;
import?org.hibernate.Transaction;
import?com.aptech.query.HqlExecute;
import?com.hbm.HibernateSessionFactory;
import?com.pojo.OaGetmassage;
import?com.pojo.OaSendmessage;
import?com.pojo.OaUser;
public?class?Common?implements?ICommon?{
public?void?save(POJO?pojo)?throws?CommonException?{
Session?session?=?HibernateSessionFactory.getSession();
Transaction?trans?=?session.beginTransaction();
try?{
session.save(pojo);
trans.commit();
}?catch?(HibernateException?e)?{
//?TODO?Auto-generated?catch?block
trans.rollback();
e.printStackTrace();
throw?new?CommonException(e);
}?finally?{
HibernateSessionFactory.closeSession();
}
}
public?void?update(POJO?pojo)?throws?CommonException?{
Session?session?=?HibernateSessionFactory.getSession();
Transaction?trans?=?session.beginTransaction();
try?{
session.update(pojo);
trans.commit();
}?catch?(HibernateException?e)?{
e.printStackTrace();
trans.rollback();
throw?new?CommonException(e);
}?finally?{
HibernateSessionFactory.closeSession();
}
}
public?void?delete(POJO?pojo)?throws?CommonException?{
Session?session?=?HibernateSessionFactory.getSession();
Transaction?trans?=?session.beginTransaction();
try?{
session.delete(pojo);
trans.commit();
}?catch?(HibernateException?e)?{
e.printStackTrace();
trans.rollback();
throw?new?CommonException(e);
}?finally?{
HibernateSessionFactory.closeSession();
}
}
public?void?delete(Class?clazz?int?id)?throws?CommonException?{
Session?session?=?HibernateSessionFactory.getSession();
Transaction?trans?=?session.beginTransaction();
try?{
object?obj?=?session.load(clazz?id);
session.delete(obj);
trans.commit();
}?catch?(HibernateException?e)?{
e.printStackTrace();
trans.rollback();
throw?new?CommonException(e);
}?finally?{
HibernateSessionFactory.closeSession();
}
}
public?POJO?queryPojoById(Class?clazz?int?id)?throws?CommonException?{
Session?session?=?HibernateSessionFactory.getSession();
Transaction?trans?=?session.beginTransaction();
try?{
object?obj?=?session.get(clazz?id);
trans.commit();
return?(POJO)?obj;
}?catch?(HibernateException?e)?{
e.printStackTrace();
trans.rollback();
throw?new?CommonException(e);
}?finally?{
HibernateSessionFactory.closeSession();
}
}
public?List?queryAll(Class?clazz)?throws?CommonException?{
Session?session?=?HibernateSessionFactory.getSession();
Transaction?trans?=?session.beginTransaction();
try?{
List?list?=?session.createQuery(
“from?“?+?clazz.getSimpleName()).list();
trans.commit();
return?list;
}?catch?(HibernateException?e)?{
e.printStackTrace();
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????947??2008-04-11?19:30??OA項目\images\005.gif
?????文件??????38630??2008-04-12?22:48??OA項目\images\1.jpg
?????文件???????1707??2008-04-11?14:54??OA項目\images\AboutUs.gif
?????文件????????511??2008-04-18?20:47??OA項目\images\add.gif
?????文件????????672??2008-04-18?22:10??OA項目\images\add_depart.gif
?????文件????????547??2008-04-25?16:22??OA項目\images\ball.gif
?????文件?????????68??2008-04-18?00:15??OA項目\images\bar_hor.gif
?????文件?????????69??2008-04-18?00:15??OA項目\images\bar_ver.gif
?????文件????????304??2008-04-18?00:15??OA項目\images\bigbar.gif
?????文件?????????54??2008-04-18?01:18??OA項目\images\blank.gif
?????文件?????????56??2008-04-25?16:22??OA項目\images\bottom_center.gif
?????文件????????105??2008-04-25?16:22??OA項目\images\bottom_left.gif
?????文件?????????60??2008-04-25?16:22??OA項目\images\bottom_right.gif
?????文件????????243??2008-04-18?00:15??OA項目\images\button_left.gif
?????文件????????108??2008-04-18?00:15??OA項目\images\button_middle.gif
?????文件???????1182??2008-04-18?00:15??OA項目\images\button_plan.gif
?????文件????????246??2008-04-18?00:15??OA項目\images\button_right.gif
?????文件????????357??2008-04-18?00:15??OA項目\images\button_top_left.gif
?????文件????????170??2008-04-18?00:15??OA項目\images\button_top_middle.gif
?????文件????????348??2008-04-18?00:15??OA項目\images\button_top_right.gif
?????文件????????994??2008-04-12?19:51??OA項目\images\colligateinfo.gif
?????文件???????1048??2008-04-12?19:51??OA項目\images\communion.gif
?????文件????????522??2008-04-18?20:30??OA項目\images\del.gif
?????文件????????681??2008-04-18?20:41??OA項目\images\del_depart.gif
?????文件????????177??2008-04-25?16:22??OA項目\images\desktop_left_center.gif
?????文件????????528??2008-04-25?16:22??OA項目\images\desktop_left_left.gif
?????文件????????315??2008-04-25?16:22??OA項目\images\desktop_left_right.gif
?????文件????????190??2008-04-25?16:22??OA項目\images\desktop_right_center.gif
?????文件????????961??2008-04-25?16:22??OA項目\images\desktop_right_left.gif
?????文件????????560??2008-04-25?16:22??OA項目\images\desktop_right_right.gif
............此處省略712個文件信息
- 上一篇:曹雪虹《信息論與編碼》ppt及部分習題解答
- 下一篇:工作易人才招聘系統源碼C#
評論
共有 條評論