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

com.lab.dao.CompanyDao Maven / Gradle / Ivy

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

import com.github.youyinnn.youdbutils.dao.YouDao;
import com.github.youyinnn.youdbutils.exceptions.NoneffectiveUpdateExecuteException;
import com.github.youyinnn.youdbutils.utils.YouCollectionsUtils;
import com.lab.model.Company;

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

/**
 * @author youyinnn
 */
public class CompanyDao extends YouDao {

    public boolean addCompany(Company company) throws NoneffectiveUpdateExecuteException {

        return modelHandler.saveModel(company) == 1;

    }

    public ArrayList getAllCompany() {
        return modelHandler.getList("Select * FROM COMPANY");
    }

    public int deleteCompany(HashMap conditionMap) throws NoneffectiveUpdateExecuteException {
        return modelHandler.deleteModel(conditionMap,"AND");
    }

    public String getName(Integer id) {
        return (String) modelHandler.getModelFieldValue("name",
                YouCollectionsUtils.getYouHashMap("id", id), "AND");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy