/**
* TNTConcept Easy Enterprise Management by Autentia Real Bussiness Solution S.L.
* Copyright (C) 2007 Autentia Real Bussiness Solution S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.autentia.tnt.manager.admin;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.autentia.tnt.businessobject.Province;
import com.autentia.tnt.dao.SortCriteria;
import com.autentia.tnt.dao.hibernate.ProvinceDAO;
import com.autentia.tnt.dao.search.ProvinceSearch;
import com.autentia.tnt.util.SpringUtils;
public class ProvinceManager
{
/* generated by stajanov (do not edit/delete) */
/** Logger */
private static final Log log = LogFactory.getLog(ProvinceManager.class);
/** Province DAO **/
private ProvinceDAO provinceDAO;
/**
* Get default ProvinceManager as defined in Spring's configuration file.
* @return the default singleton ProvinceManager
*/
public static ProvinceManager getDefault()
{
return (ProvinceManager)SpringUtils.getSpringBean("managerProvince");
}
/**
* Empty constructor needed by CGLIB (Spring AOP)
*/
protected ProvinceManager()
{
}
/**
* Default constructor
* @deprecated do not construct managers alone: use Spring's declared beans
*/
public ProvinceManager( ProvinceDAO provinceDAO )
{
this.provinceDAO = provinceDAO;
}
/**
* List provinces.
* @param search search filter to apply
* @param sort sorting criteria
* @return the list of all provinces sorted by requested criterion
*/
public List<Province> getAllEntities(ProvinceSearch search, SortCriteria sort){
return provinceDAO.search( search, sort );
}
/**
* Get province by primary key.
* @return province selected by id.
*/
public Province getEntityById(int id){
return provinceDAO.getById(id);
}
/**
* Insert province.
*/
public void insertEntity(Province province) {
provinceDAO.insert(province);
}
/**
* Update province.
*/
public void updateEntity(Province province) {
provinceDAO.update(province);
}
/**
* Delete province.
*/
public void deleteEntity(Province province) {
provinceDAO.delete(province);
}
/* generated by stajanov (do not edit/delete) */
}