AssortServiceImpl.java
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:2k
源码类别:
Jsp/Servlet
开发平台:
Java
- package org.yufeng.service.serviceImpl;
- import java.util.ArrayList;
- import java.util.List;
- import org.apache.log4j.Logger;
- import org.yufeng.dao.IAssortDao;
- import org.yufeng.domains.Assort;
- import org.yufeng.service.IAssortServiceDao;
- import org.yufeng.service.ISortServiceDao;
- import org.yufeng.utils.AppContext;
- public class AssortServiceImpl implements IAssortServiceDao {
- private IAssortDao assortDao;
- public List browseAssort(){
- return getAssortDao().browseAssort();
- }
- public List browseAssortById(Integer id){
- return getAssortDao().browseAssortById(id);
- }
- public List browseAllAssortById(Integer id){
- return getAssortDao().browseAllAssortById(id);
- }
- public Assort loadAssort(Integer id){
- return getAssortDao().loadAssort(id);
- }
- public boolean delAssort(Assort assort){
- return getAssortDao().delAssort(assort);
- }
- public boolean delAllAssort(String[] id){
- boolean flag=false;
- try {
- for(int i=0;i<id.length;i++){
- getAssortDao().delAllAssort(id[i]);
- }
- flag=true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return flag;
- }
- public boolean addAssort(Assort assort){
- return getAssortDao().addAssort(assort);
- }
- public boolean updateSort(String as_name,String edit_name){
- return getAssortDao().updateSort(as_name, edit_name);
- }
- public IAssortDao getAssortDao() {
- return this.assortDao;
- }
- public void setAssortDao(IAssortDao assortDao) {
- this.assortDao = assortDao;
- }
- public static void main(String[] args) {
- IAssortServiceDao test = (IAssortServiceDao)AppContext.getInstance().getAppContext().getBean("assortTarget");
- try {
- String[] id = {"10","14"};
- boolean size = test.delAllAssort(id);
- System.out.println("size is "+size);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }