SortServiceImpl.java
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:1k
- package org.yufeng.service.serviceImpl;
- import java.util.ArrayList;
- import java.util.List;
- import org.apache.log4j.Logger;
- import org.yufeng.dao.ISortDao;
- import org.yufeng.domains.Sort;
- import org.yufeng.service.ISortServiceDao;
- import org.yufeng.utils.AppContext;
- public class SortServiceImpl implements ISortServiceDao {
- private ISortDao sortDao;
- public List browseSort(){
- return getSortDao().browseSort();
- }
- public Sort loadSort(Integer id){
- return getSortDao().loadSort(id);
- }
- public boolean delSort(Sort sort){
- return getSortDao().delSort(sort);
- }
- public boolean addSort(Sort sort){
- return getSortDao().addSort(sort);
- }
- public boolean updateSort(String so_name,String edit_name){
- return getSortDao().updateSort(so_name, edit_name);
- }
- public ISortDao getSortDao() {
- return this.sortDao;
- }
- public void setSortDao(ISortDao sortDao) {
- this.sortDao = sortDao;
- }
- public static void main(String[] args) {
- ISortServiceDao test = (ISortServiceDao)AppContext.getInstance().getAppContext().getBean("sortTarget");
- try {
- int size = test.browseSort().size();
- for(int i = 0;i<size ; i++){
- Sort sort = (Sort)test.browseSort().get(i);
- System.out.println("so_name"+sort.getSo_name());
- }
- System.out.println("size is "+size);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }