Package ru.bgcrm.dao.process
Class ProcessDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.process.ProcessDAO
- Direct Known Subclasses:
GroupLoadDAO
,ProcessMessageDAO
,ProcessQueueDAO
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DynActionForm
User request context for isolations, logging changes, l10n.static final String
static final int
static final int
static final int
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, 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_WHERE
-
Constructor Summary
ConstructorDescriptionProcessDAO
(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 TypeMethodDescriptionvoid
deleteProcess
(int processId) static String
getIsolationJoin
(DynActionForm form, String tableProcess) getProcess
(int id) Selects process by ID with the lastProcess.getStatusChange()
.static Process
static Process
getProcessFromRs
(ResultSet rs, String prefix) getProcessOrThrow
(int id) Selects process usinggetProcess(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) Searches processes with user as an executor.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
-
Field Details
-
LINKED_PROCESS
- See Also:
-
MODE_USER_CREATED
public static final int MODE_USER_CREATED- See Also:
-
MODE_USER_CLOSED
public static final int MODE_USER_CLOSED- See Also:
-
MODE_USER_STATUS_CHANGED
public static final int MODE_USER_STATUS_CHANGED- See Also:
-
form
User request context for isolations, logging changes, l10n.
-
-
Constructor Details
-
ProcessDAO
Constructor without user isolation and history writing.- Parameters:
con
- DB connection.
-
ProcessDAO
Constructor with isolation support and writing history.- Parameters:
con
- DB connection.form
- value ofform
.
-
-
Method Details
-
getProcessFromRs
- Throws:
SQLException
-
getProcessFromRs
- Throws:
SQLException
-
getIsolationJoin
-
getProcess
Selects process by ID with the lastProcess.getStatusChange()
. Selection respects user isolations.- Parameters:
id
- DB record ID.- Returns:
- Throws:
SQLException
-
getProcessOrThrow
Selects process usinggetProcess(int)
.- Parameters:
id
- DB record ID.- Returns:
- Throws:
SQLException
javassist.NotFoundException
- no record found withid
.
-
updateProcessTitle
- Throws:
SQLException
-
updateProcessGroups
- Throws:
SQLException
-
updateProcessExecutors
public void updateProcessExecutors(Set<ProcessExecutor> processExecutors, int processId) throws SQLException - Throws:
SQLException
-
updateProcess
- Throws:
SQLException
-
deleteProcess
- Throws:
SQLException
-
processIdInvert
- 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
- resultaddressParamIds
- param IDs used for search.houseId
- house IDhouseFlat
- flathouseRoom
- room- Throws:
SQLException
-
searchProcessListForUser
public void searchProcessListForUser(Pageable<Process> searchResult, int userId, Boolean open) throws SQLException Searches processes with user as an executor.- Parameters:
searchResult
- paged result.userId
- user ID.open
- if notnull
then process opened filter.- 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
-