Package ru.bgcrm.dao.process

# Class ProcessDAO

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

Direct Known Subclasses:
  `ProcessMessageDAO`, `ProcessQueueDAO`

public class ProcessDAO extends CommonDAO

- ## 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, logging changes, l10n.
  `static final String`
  `LINKED_PROCESS`
  `static final int`
  `MODE_USER_CLOSED`
  `static final int`
  `MODE_USER_CREATED`
  `static final int`
  `MODE_USER_STATUS_CHANGED`

  ### 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
  `ProcessDAO(Connection con)`
  Constructor without user isolation and history writing.
  `ProcessDAO(Connection con, DynActionForm form)`
  Constructor with isolation support and writing history.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `deleteProcess(int processId)`
  `static String`
  `getIsolationJoin(DynActionForm form, String tableProcess)`
  `Process`
  `getProcess(int id)`
  Selects process by ID with the last `Process.getStatusChange()`.
  `static Process`
  `getProcessFromRs(ResultSet rs)`
  `static Process`
  `getProcessFromRs(ResultSet rs, String prefix)`
  `Process`
  `getProcessOrThrow(int id)`
  Selects process using `getProcess(int)`.
  `void`
  `processIdInvert(Process process)`
  `void`
  `searchProcessListByAddress(Pageable<ParameterSearchedObject<Process>> searchResult, Set<Integer> typeIds, Set<Integer> addressParamIds, int houseId, String houseFlat, String houseRoom)`
  Search processes by 'address' param.
  `void`
  `searchProcessListForUser(Pageable<Process> searchResult, int userId, int mode)`
  Выбирает связанные с процессом процессы.
  `void`
  `searchProcessListForUser(Pageable<Process> searchResult, int userId, Boolean open)`
  Deprecated.
  `Process`
  `updateProcess(Process process)`
  `void`
  `updateProcessExecutors(Set<ProcessExecutor> processExecutors, int processId)`
  `void`
  `updateProcessGroups(Set<ProcessGroup> processGroups, int processId)`
  `void`
  `updateProcessTitle(int processId, String title)`

  ### 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

  - ### LINKED_PROCESS

    public static final String LINKED_PROCESS
    See Also:
      - Constant Field Values

  - ### MODE_USER_CREATED

    public static final int MODE_USER_CREATED
    See Also:
      - Constant Field Values

  - ### MODE_USER_CLOSED

    public static final int MODE_USER_CLOSED
    See Also:
      - Constant Field Values

  - ### MODE_USER_STATUS_CHANGED

    public static final int MODE_USER_STATUS_CHANGED
    See Also:
      - Constant Field Values

  - ### form

    protected final DynActionForm form
    User request context for isolations, logging changes, l10n.

- ## Constructor Details

  - ### ProcessDAO

    public ProcessDAO(Connection con)
    Constructor without user isolation and history writing.
    Parameters:
      `con` - DB connection.

  - ### ProcessDAO

    public ProcessDAO(Connection con, DynActionForm form)
    Constructor with isolation support and writing history.
    Parameters:
      `con` - DB connection.
      `form` - value of `form`.

- ## Method Details

  - ### getProcessFromRs

    public static Process getProcessFromRs(ResultSet rs, String prefix) throws SQLException
    Throws:
      `SQLException`

  - ### getProcessFromRs

    public static Process getProcessFromRs(ResultSet rs) throws SQLException
    Throws:
      `SQLException`

  - ### getIsolationJoin

    public static String getIsolationJoin(DynActionForm form, String tableProcess)

  - ### getProcess

    public Process getProcess(int id) throws SQLException
    Selects process by ID with the last `Process.getStatusChange()`. Selection respects user isolations.
    Parameters:
      `id` - DB record ID.
    Returns:
    Throws:
      `SQLException`

  - ### getProcessOrThrow

    public Process getProcessOrThrow(int id) throws SQLException, javassist.NotFoundException
    Selects process using `getProcess(int)`.
    Parameters:
      `id` - DB record ID.
    Returns:
    Throws:
      `SQLException`
      `javassist.NotFoundException` - no record found with `id`.

  - ### updateProcessTitle

    public void updateProcessTitle(int processId, String title) throws SQLException
    Throws:
      `SQLException`

  - ### updateProcessGroups

    public void updateProcessGroups(Set<ProcessGroup> processGroups, int processId) throws SQLException
    Throws:
      `SQLException`

  - ### updateProcessExecutors

    public void updateProcessExecutors(Set<ProcessExecutor> processExecutors, int processId) throws SQLException
    Throws:
      `SQLException`

  - ### updateProcess

    public Process updateProcess(Process process) throws SQLException
    Throws:
      `SQLException`

  - ### deleteProcess

    public void deleteProcess(int processId) throws SQLException
    Throws:
      `SQLException`

  - ### processIdInvert

    public void processIdInvert(Process process) throws SQLException
    Throws:
      `SQLException`

  - ### searchProcessListByAddress

    public void searchProcessListByAddress(Pageable<ParameterSearchedObject<Process>> searchResult, Set<Integer> typeIds, Set<Integer> addressParamIds, int houseId, String houseFlat, String houseRoom) throws SQLException
    Search processes by 'address' param.
    Parameters:
      `searchResult` - result
      `addressParamIds` - param IDs used for search.
      `houseId` - house ID
      `houseFlat` - flat
      `houseRoom` - room
    Throws:
      `SQLException`

  - ### searchProcessListForUser

    @Deprecated public void searchProcessListForUser(Pageable<Process> searchResult, int userId, Boolean open) throws SQLException
    Deprecated.
    Use
    invalid reference

        ProcessSearchDAO

    Throws:
      `SQLException`

  - ### searchProcessListForUser

    public void searchProcessListForUser(Pageable<Process> searchResult, int userId, int mode) throws SQLException
    Выбирает связанные с процессом процессы.
    Parameters:
      `searchResult` -
      `userId` - код пользователя.
      `mode` - принимает значения `MODE_USER_CREATED`, `MODE_USER_CLOSED`, `MODE_USER_STATUS_CHANGED`.
    Throws:
      `SQLException`