📄 specialserviceimpl.java
字号:
/* * SpecialServiceImpl.java * * Created on 2006年5月20日, 下午4:39 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package enova.service.impl;import java.util.*;import enova.dao.*;import enova.pojo.*;import enova.service.*;/** * * @author vlinux */public class SpecialServiceImpl implements SpecialService { private SpecialDao specialDao; /** Creates a new instance of SpecialServiceImpl */ public SpecialServiceImpl(SpecialDao specialDao) { this.specialDao = specialDao; } /*通过ID获取专业*/ public Special get(Integer specialId) throws StoreException{ try{ return specialDao.getId(specialId); }catch(DataAccessException dae){ throw new StoreException(); } } /*更新或创建一个专业,如果该学院中该专业的组合已经存在,则抛出重复异常*/ public void updateOrCreate(Special special) throws UniqueException, StoreException{ try{ specialDao.updateOrInsert(special); }catch(DataAccessException dae){ throw new StoreException(); }catch(RecordExistException ree){ throw new UniqueException(); } } /*通过ID删除专业*/ public void delete(Integer specialId) throws NotExistException, StoreException{ try{ if( specialDao.getId(specialId)==null ) throw new NotExistException(); specialDao.delete(specialId); }catch(DataAccessException dae){ throw new StoreException(); } } /*通过学院ID获取该学院所开设的所有专业*/ public List getByDepartmentId( Integer departmentId ) throws StoreException{ try{ return specialDao.getByDepartmentId(departmentId); }catch(DataAccessException dae){ throw new StoreException(); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -