/**
* 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.activity;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.autentia.tnt.businessobject.Occupation;
import com.autentia.tnt.dao.SortCriteria;
import com.autentia.tnt.dao.hibernate.OccupationDAO;
import com.autentia.tnt.dao.search.OccupationSearch;
import com.autentia.tnt.util.SpringUtils;
public class OccupationManager {
/* occupation - generated by stajanov (do not edit/delete) */
/** Logger */
private static final Log log = LogFactory.getLog(OccupationManager.class);
/** Occupation DAO **/
private OccupationDAO occupationDAO;
/**
* Get default OccupationManager as defined in Spring's configuration file.
* @return the default singleton OccupationManager
*/
public static OccupationManager getDefault()
{
return (OccupationManager)SpringUtils.getSpringBean("managerOccupation");
}
/**
* Empty constructor needed by CGLIB (Spring AOP)
*/
protected OccupationManager()
{
}
/**
* Default constructor
* @deprecated do not construct managers alone: use Spring's declared beans
*/
public OccupationManager( OccupationDAO occupationDAO )
{
this.occupationDAO = occupationDAO;
}
/**
* List occupations.
* @param search search filter to apply
* @param sort sorting criteria
* @return the list of all occupations sorted by requested criterion
*/
public List<Occupation> getAllEntities(OccupationSearch search, SortCriteria sort){
return occupationDAO.search( search, sort );
}
/**
* Get occupation by primary key.
* @return occupation selected by id.
*/
public Occupation getEntityById(int id){
return occupationDAO.getById(id);
}
/**
* Insert occupation.
*/
public void insertEntity(Occupation occupation) {
occupationDAO.insert(occupation);
}
/**
* Update occupation.
*/
public void updateEntity(Occupation occupation) {
occupationDAO.update(occupation);
}
/**
* Delete occupation.
*/
public void deleteEntity(Occupation occupation) {
occupationDAO.delete(occupation);
}
/* occupation - generated by stajanov (do not edit/delete) */
}