Package com.dotmarketing.portlets.workflowmessages.factories

Source Code of com.dotmarketing.portlets.workflowmessages.factories.ActionFactory

package com.dotmarketing.portlets.workflowmessages.factories;

import java.util.ArrayList;
import java.util.List;

import com.dotmarketing.db.HibernateUtil;
import com.dotmarketing.exception.DotHibernateException;
import com.dotmarketing.portlets.workflowmessages.model.Action;
import com.dotmarketing.util.Logger;



/**
*
* @author Rocco
*/
public class ActionFactory {
   
  // public static final long ACTION_PUBLISH = 5;
 
  public static Action getActionById(long actionId) {
    HibernateUtil dh = new HibernateUtil(Action.class);
    Action myAction = null;
    try {
      dh.setQuery(
        "from action in class com.dotmarketing.portlets.workflowmessages.model.Action where id = ?");
      dh.setParam(actionId);
      myAction = (Action) dh.load();
    } catch (DotHibernateException e) {
      Logger.error(ActionFactory.class,e.getMessage(),e);
    }
    return myAction;
  }

  public static java.util.List getActionsByAntiStatusId(long statusId) {
    HibernateUtil dh = new HibernateUtil(Action.class);
    List actionList =null;
    try {
      dh.setQuery(
        "from action in class com.dotmarketing.portlets.workflowmessages.model.Action where anti_status_id = ?");
      dh.setParam(statusId);
      actionList = dh.list();
    } catch (DotHibernateException e) {
      Logger.error(ActionFactory.class,e.getMessage(),e);
    }
    return actionList;
  }

}
TOP

Related Classes of com.dotmarketing.portlets.workflowmessages.factories.ActionFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.