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