Class ProcessTypeDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.process.ProcessTypeDAO

public class ProcessTypeDAO extends CommonDAO
  • Constructor Details

    • ProcessTypeDAO

      public ProcessTypeDAO(Connection con)
  • Method Details

    • searchProcessType

      public void searchProcessType(Pageable<ProcessType> result, int parentId, String filterLike) throws Exception
      Searches process types
      Parameters:
      result - the result
      parentId - when greater 0 - filter by parent type id
      filterLike - when not null or empty, SQL LIKE expression to filter by ID, title, or config
      Throws:
      Exception
    • getProcessType

      public ProcessType getProcessType(int id) throws Exception
      Selects process type by ID
      Parameters:
      id - the type ID
      Returns:
      the process type, or null if not found
      Throws:
      Exception
    • getTypeChildren

      public List<ProcessType> getTypeChildren(int parentId, Set<Integer> excludeIds) throws Exception
      Throws:
      Exception
    • getFullProcessTypeList

      public List<ProcessType> getFullProcessTypeList() throws SQLException
      Returns a list of all process types sorted by title
      Returns:
      the process type list
      Throws:
      SQLException
    • getSortedProcessTypeStatusList

      @Deprecated public List<Status> getSortedProcessTypeStatusList(ProcessType type, List<Integer> sortingId)
      Deprecated.
    • getProcessTypeStatusList

      @Deprecated public List<Status> getProcessTypeStatusList(ProcessType type)
      Deprecated.
    • updateProcessType

      public void updateProcessType(ProcessType processType, int userId) throws Exception
      Updates or creates a process type entity
      Parameters:
      processType - the process type
      userId - the user ID
      Throws:
      Exception
    • updateTypeProperties

      public void updateTypeProperties(ProcessType type)
      Updates process type properties
      Parameters:
      type - the process type
    • copyTypeProperties

      public void copyTypeProperties(int fromTypeId, int toTypeId) throws Exception
      Copies process type properties
      Parameters:
      fromTypeId - the source type ID
      toTypeId - the target type ID
      Throws:
      Exception
    • checkProcessTypeForDelete

      public boolean checkProcessTypeForDelete(int id) throws Exception
      Parameters:
      id - the type ID
      Returns:
      true if the directory is empty and can be deleted
      Throws:
      Exception
    • deleteProcessType

      public boolean deleteProcessType(int id) throws Exception
      Deletes process type
      Parameters:
      id - the type ID
      Returns:
      true if deleted
      Throws:
      Exception
    • checkType

      public boolean checkType(int id, int parentId, String title) throws Exception
      Checks whether the parent type already has a child with the given title
      Parameters:
      id - the type ID to exclude from the check (itself)
      parentId - the parent type ID
      title - the title
      Returns:
      true if no such child exists
      Throws:
      Exception