Package ru.bgcrm.dao.process

# Class ProcessLinkDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.CommonLinkDAO
ru.bgcrm.dao.process.ProcessLinkDAO

public class ProcessLinkDAO extends CommonLinkDAO
Process links DAO.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO

  `CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final DynActionForm`
  `form`
  User request context for isolations.

  ### Fields inherited from class ru.bgcrm.dao.CommonDAO

  `con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE_INTO, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProcessLinkDAO(Connection con)`
  Constructor without isolations.
  `ProcessLinkDAO(Connection con, DynActionForm form)`
  Constructor, respecting isolations for methods: `getLinkedProcessList(int, String, boolean, Set)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `checkCycles(int processId)`
  Checks cyclic dependencies.
  `protected String`
  `getColumnName()`
  `Set<Customer>`
  `getLinkCustomers(int processId, String linkObjectType)`
  Selects customers links for process.
  `Pair<Integer,Integer>`
  `getLinkedProcessesCounts(int processId)`
  Selects counts of linked and link processes to a given process.
  `List<Process>`
  `getLinkedProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds)`
  Возвращает процессы, к которым привязан процесс.
  `Set<Integer>`
  `getLinkedProcessTypeIdList(String objectType, int objectId)`
  Deprecated.
  `List<Process>`
  `getLinkProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds)`
  Возвращает процессы, привязанные к процессу.
  `Collection<CommonObjectLink>`
  `getLinksOver(Set<Integer> processIds)`
  Возвращает связи внутри набора процессов.
  `protected String`
  `getObjectType()`
  `protected String`
  `getTable()`
  `void`
  `linkToAnotherObject(int objectFromId, String typeObjectFrom, int objectToId, String typeObjectTo, String typePrefix, String excludeType)`

  ### Methods inherited from class ru.bgcrm.dao.CommonLinkDAO

  `addLink, addLinkIfNotExist, copyLinks, copyLinks, deleteLink, deleteLinksTo, deleteLinksWithType, deleteObjectLinks, getLinkDAO, getObjectLinksWithType, isLinkExists, prepareLink, updateLinkTitles`

  ### Methods inherited from class ru.bgcrm.dao.CommonDAO

  `deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### form

    protected final DynActionForm form
    User request context for isolations.

- ## Constructor Details

  - ### ProcessLinkDAO

    public ProcessLinkDAO(Connection con)
    Constructor without isolations.
    Parameters:
      `con` - DB connection.

  - ### ProcessLinkDAO

    public ProcessLinkDAO(Connection con, DynActionForm form)
    Constructor, respecting isolations for methods: `getLinkedProcessList(int, String, boolean, Set)`
    Parameters:
      `con` - DB connection.
      `form` - form object with a user.

- ## Method Details

  - ### getTable

    protected String getTable()
    Specified by:
      `getTable` in class `CommonLinkDAO`

  - ### getColumnName

    protected String getColumnName()
    Specified by:
      `getColumnName` in class `CommonLinkDAO`

  - ### getObjectType

    protected String getObjectType()
    Specified by:
      `getObjectType` in class `CommonLinkDAO`

  - ### linkToAnotherObject

    public void linkToAnotherObject(int objectFromId, String typeObjectFrom, int objectToId, String typeObjectTo, String typePrefix, String excludeType) throws SQLException
    Throws:
      `SQLException`

  - ### getLinkProcessList

    public List<Process> getLinkProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) throws SQLException
    Возвращает процессы, привязанные к процессу.
    Parameters:
      `processId` - код процесса.
      `linkType` - если не null, то SQL LIKE выражение фильтр по типу связи `Process.LINK_TYPE_DEPEND`, `Process.LINK_TYPE_LINK`, `Process.LINK_TYPE_MADE`.
      `onlyOpen` - только открытые.
      `typeIds` - если не null, то фильтр по типам процессов.
    Returns:
    Throws:
      `SQLException`

  - ### getLinkedProcessList

    public List<Process> getLinkedProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) throws SQLException
    Возвращает процессы, к которым привязан процесс.
    Parameters:
      `processId` - код процесса.
      `linkType` - если не null, то SQL LIKE выражение фильтр по типу связи `Process.LINK_TYPE_DEPEND`, `Process.LINK_TYPE_LINK`, `Process.LINK_TYPE_MADE`.
      `onlyOpen` - выбирать только открытые процессы.
      `typeIds` - если не null, то фильтр по типам процессов.
    Returns:
    Throws:
      `SQLException`

  - ### getLinksOver

    public Collection<CommonObjectLink> getLinksOver(Set<Integer> processIds) throws SQLException
    Возвращает связи внутри набора процессов.
    Parameters:
      `processIds` - коды процессов из набора.
    Returns:
    Throws:
      `SQLException`

  - ### checkCycles

    public boolean checkCycles(int processId) throws Exception
    Checks cyclic dependencies.
    Parameters:
      `processId` -
    Returns:
    Throws:
      `Exception`

  - ### getLinkCustomers

    public Set<Customer> getLinkCustomers(int processId, String linkObjectType) throws SQLException
    Selects customers links for process.
    Parameters:
      `processId` - process ID.
      `linkObjectType` - optional SQL LIKE filter by link object type.
    Returns:
    Throws:
      `SQLException`

  - ### getLinkedProcessesCounts

    public Pair<Integer,Integer> getLinkedProcessesCounts(int processId) throws SQLException
    Selects counts of linked and link processes to a given process. Note that process isolation is not taken here on account.
    Parameters:
      `processId` - the process ID.
    Returns:
      a pair with linked count on the first place, links count on the second.
    Throws:
      `SQLException`

  - ### getLinkedProcessTypeIdList

    @Deprecated public Set<Integer> getLinkedProcessTypeIdList(String objectType, int objectId) throws SQLException
    Deprecated.
    Throws:
      `SQLException`