Class DemandService


  • public class DemandService
    extends Object
    DemandService
    • Method Detail

      • findByPrimaryKey

        public Demand findByPrimaryKey​(int nIdDemand)
        Find a demand by its primary key
        Parameters:
        nIdDemand - the id demand
        Returns:
        a Demand
      • findByRemoteKey

        public Demand findByRemoteKey​(String strRemoteId,
                                      int nIdDemandType)
        Find a demand by Remote key
        Parameters:
        strRemoteId - the remote Id
        nIdDemandType - the idDemandType
        Returns:
        a Demand
      • create

        public int create​(Demand demand)
        Create a new demand
        Parameters:
        demand - the demand
        Returns:
        the newly created demand id
      • update

        public void update​(Demand demand)
        Update a demand
        Parameters:
        demand - the demand
      • remove

        public void remove​(int nIdDemand)
        Remove a demand
        Parameters:
        nIdDemand - the id demand
      • removeWithItsResource

        public void removeWithItsResource​(int nIdDemand,
                                          boolean bByDaemon)
        Remove a demand and its resource
        Parameters:
        nIdDemand - the id demand
      • removeByIdDemandType

        public void removeByIdDemandType​(int nIdDemandType)
        Remove the demands given an id demand type
        Parameters:
        nIdDemandType - the id demand type
      • findAll

        public List<Demand> findAll()
        Find all demands
        Returns:
        a list of Demand
      • findByFilter

        public List<Demand> findByFilter​(DemandFilter dFilter)
        Find by filter
        Parameters:
        dFilter - the filter
        Returns:
        a list of Demand
      • findByIdCRMUser

        public Map<String,​List<Demand>> findByIdCRMUser​(int nIdCRMUser,
                                                              Locale locale,
                                                              int nIdStatusToSort,
                                                              List<DemandSort> listDemandSort)
        Find the demands given an user crm id, results can be sorted
        Parameters:
        nIdCRMUser - the user crm id
        locale - Locale
        nIdStatusToSort - the id status of demands that will be sorted
        listDemandSort - the sorts to apply
        Returns:
        a map of (id_status_crm, List<Demand>)
      • findByFilterWithPagination

        public List<Demand> findByFilterWithPagination​(DemandFilter dFilter,
                                                       IPaginationProperties paginationProperties)
        Find by filter with pagination
        Parameters:
        dFilter - the filter
        paginationProperties - the pagination properties
        Returns:
        a list of Demand
      • countByFilter

        public int countByFilter​(DemandFilter dFilter)
        Count results by filter
        Parameters:
        dFilter - the filter
        Returns:
        the number of results