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