All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lab.service.CompanyService Maven / Gradle / Ivy

There is a newer version: 2.2.3
Show newest version
package com.lab.service;

import com.github.youyinnn.youdbutils.exceptions.NoneffectiveUpdateExecuteException;
import com.github.youyinnn.youdbutils.ioc.annotations.Autowired;
import com.github.youyinnn.youdbutils.ioc.annotations.YouService;
import com.lab.dao.CompanyDao;
import com.lab.model.Company;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * @author youyinnn
 */
@YouService
public class CompanyService {

    @Autowired
    private CompanyDao dao;

    public boolean addCompany(Company company) {
        try {
            return dao.addCompany(company);
        } catch (NoneffectiveUpdateExecuteException e) {
            e.printStackTrace();
        }
        return false;
    }

    public ArrayList getAllCompany(){
        return dao.getAllCompany();
    }

    public int delete(HashMap co){
        try {
            return dao.deleteCompany(co);
        } catch (NoneffectiveUpdateExecuteException e) {
            e.printStackTrace();
        }
        return 0;
    }

    public String getName(Integer id) {
        return dao.getName(id);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy