LeavesServiceImpl.java
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
Java
- package org.yufeng.service.serviceImpl;
- import java.util.List;
- import org.yufeng.dao.ILeavesDao;
- import org.yufeng.domains.Leaves;
- import org.yufeng.service.ILeavesServiceDao;
- import org.yufeng.utils.AppContext;
- public class LeavesServiceImpl implements ILeavesServiceDao {
- ILeavesDao leavesDao;
- public ILeavesDao getLeavesDao() {
- return leavesDao;
- }
- public void setLeavesDao(ILeavesDao leavesDao) {
- this.leavesDao = leavesDao;
- }
- public boolean addLeaves(Leaves leaves) {
- return this.getLeavesDao().addLeaves(leaves);
- }
- public List browseALeaves() {
- return this.getLeavesDao().browseALeaves();
- }
- public boolean delLeaves(Leaves leaves) {
- return this.getLeavesDao().delLeaves(leaves);
- }
- public Leaves loadLeaves(Integer id) {
- return this.getLeavesDao().loadLeaves(id);
- }
- public boolean updateLeaves(Leaves leaves) {
- return this.getLeavesDao().updateLeaves(leaves);
- }
- public static void main(String[] args) {
- ILeavesServiceDao test = (ILeavesServiceDao) AppContext.getInstance()
- .getAppContext().getBean("leavesTarget");
- System.out.println(test);
- try {
- Leaves leaves = new Leaves();
- leaves.setLe_id(12);
- boolean flag = test.delLeaves(leaves);
- // System.out.println("size is "+size);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }