ResumeService.java
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- package com.chinacannel.xlchemical.service;
- import com.chinacannel.common.TranUtil;
- import com.chinacannel.common.CommonDAO;
- import org.apache.commons.logging.LogFactory;
- import org.apache.commons.logging.Log;
- import com.chinacannel.common.DAOException;
- import com.chinacannel.entity.Resume;
- import java.util.List;
- import com.chinacannel.common.PageInfo;
- import com.chinacannel.entity.Jobs;
- public class ResumeService extends TranUtil {
- private CommonDAO dao = new CommonDAO();
- private static Log log = LogFactory.getLog(ResumeService.class);
- public boolean AddResume(Resume res) {
- try {
- return dao.createObject(res);
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return false;
- }
- }
- public Resume GetResumeById(Long resID) {
- try {
- return (Resume) dao.loadObject(resID, Resume.class);
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return null;
- }
- }
- public boolean DeletResume(Jobs job) {
- try {
- dao.executeDelete("from Resume as res where res.jobs.job_ID=" +
- job.getJob_ID());
- return true;
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return false;
- }
- }
- public boolean DeleteResume(Resume res) {
- try {
- return dao.removeObject(res);
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return false;
- }
- }
- public List getResumeList(int start, int top) {
- try {
- String hql = "from Resume as res order by res.res_Time desc";
- return dao.loadObjectListBySQL(hql, start, top);
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return null;
- }
- }
- public int getCount() {
- String hql = "select count(*) from Resume";
- int count = 0;
- try {
- int o = dao.getCountBySql(hql);
- count = o;
- } catch (DAOException ex) {
- }
- return count;
- }
- public PageInfo getPageInfo(int pageno) {
- PageInfo pageInfo = new PageInfo(this.getCount(), pageno, 10);
- pageInfo.setRows(this.getResumeList(pageInfo.getStartRow(),
- pageInfo.getPageSize()));
- return pageInfo;
- }
- }