Class ProcessLinkDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.CommonLinkDAO
ru.bgcrm.dao.process.ProcessLinkDAO
Process links DAO
-
Nested Class Summary
Nested classes/interfaces inherited from class CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DynActionFormUser request context for isolations.Fields inherited from class 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
ConstructorsConstructorDescriptionProcessLinkDAO(Connection con) Constructor without isolationsProcessLinkDAO(Connection con, DynActionForm form) Constructor, respecting isolations for methods:getLinkedProcessList(int, String, boolean, Set) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckCycles(int processId) Checks cyclic dependenciesprotected StringgetLinkCustomers(int processId, String linkObjectType) Selects customers links for processgetLinkedProcessesCounts(int processId) Selects counts of linked and link processes to a given process.getLinkedProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) Returns processes the process is linked togetLinkedProcessTypeIdList(String objectType, int objectId) Deprecated.getLinkProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) Returns processes linked to the processgetLinksOver(Set<Integer> processIds) Returns links within a set of processesprotected Stringprotected StringgetTable()voidlinkToAnotherObject(int objectFromId, String typeObjectFrom, int objectToId, String typeObjectTo, String typePrefix, String excludeType) Methods inherited from class CommonLinkDAO
addLink, addLinkIfNotExist, copyLinks, copyLinks, deleteLink, deleteLinksTo, deleteLinksWithType, deleteObjectLinks, getLinkDAO, getObjectLinksWithType, isLinkExists, prepareLink, updateLinkTitlesMethods inherited from class CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Field Details
-
form
User request context for isolations.
-
-
Constructor Details
-
ProcessLinkDAO
Constructor without isolations- Parameters:
con- DB connection
-
ProcessLinkDAO
Constructor, respecting isolations for methods:getLinkedProcessList(int, String, boolean, Set)- Parameters:
con- DB connectionform- form object with a user
-
-
Method Details
-
getTable
- Specified by:
getTablein classCommonLinkDAO
-
getColumnName
- Specified by:
getColumnNamein classCommonLinkDAO
-
getObjectType
- Specified by:
getObjectTypein classCommonLinkDAO
-
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 Returns processes linked to the process- Parameters:
processId- the process IDlinkType- if notnull, SQL LIKE expression filter by link type:Process.LINK_TYPE_DEPEND,Process.LINK_TYPE_LINK,Process.LINK_TYPE_MADEonlyOpen- only open onestypeIds- if notnull, filter by process types- Returns:
- the process list
- Throws:
SQLException
-
getLinkedProcessList
public List<Process> getLinkedProcessList(int processId, String linkType, boolean onlyOpen, Set<Integer> typeIds) throws SQLException Returns processes the process is linked to- Parameters:
processId- the process IDlinkType- if notnull, SQL LIKE expression filter by link type:Process.LINK_TYPE_DEPEND,Process.LINK_TYPE_LINK,Process.LINK_TYPE_MADEonlyOpen- select only open processestypeIds- if notnull, filter by process types- Returns:
- the process list
- Throws:
SQLException
-
getLinksOver
Returns links within a set of processes- Parameters:
processIds- the process IDs of the set- Returns:
- the links
- Throws:
SQLException
-
checkCycles
-
getLinkCustomers
Selects customers links for process- Parameters:
processId- process IDlinkObjectType- optional SQL LIKE filter by link object type- Returns:
- the customers
- Throws:
SQLException
-
getLinkedProcessesCounts
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
-