Package org.bgerp.dao.param
Class ParamValueDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.dao.param.ParamValueDAO
- Direct Known Subclasses:
- ParamValueDAO
Parameter values DAO. The primary required public methods are sorted alphabetically.
 Dependency methods even public, called by those, are placed directly after the first usage.
- 
Nested Class SummaryNested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAOCommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
- 
Field SummaryFieldsFields inherited from class ru.bgcrm.dao.CommonDAOcon, 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 SummaryConstructorsConstructorDescriptionParamValueDAO(Connection con) ParamValueDAO(Connection con, boolean history, int userId) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidcopyParam(int fromObjectId, int toObjectId, int paramId) Копирует параметр с объекта на объект.voidcopyParam(int fromObjectId, int fromParamId, int toObjectId, int toParamId) Копирует параметр с объекта на объект.voidcopyParams(int fromObjectId, int toObjectId, String copyMapping) Копирует параметры с объекта на другой объект по указанной конфигурации.voidcopyParams(int fromObjectId, int toObjectId, Collection<Integer> paramIds) Копирует параметры с объекта на объектvoiddeleteParams(String objectType, int id) Удаляет параметры объекта.getParamAddress(int id, int paramId) Возвращает значения адресного параметра объекта.getParamAddress(int id, int paramId, boolean loadDirs) Возвращает значения адресного параметра объекта.getParamAddress(int id, int paramId, boolean loadDirs, String formatName) Возвращает значения адресного параметра объекта.getParamAddress(int id, int paramId, int position) Возвращает адресный параметр объекта.getParamBlob(int id, int paramId) Selects a value for parameter type 'blob'.getParamDate(int id, int paramId) Selects a value for parameter type 'date'.getParamDateTime(int id, int paramId) Selects a value for parameter type 'datetime'.getParamEmail(int id, int paramId) Selects values for parameter type 'email'.getParamEmail(int id, int paramId, int position) Deprecated.getParamFile(int id, int paramId) Selects values for parameter type 'file'.getParamFile(int id, int paramId, int position) Selects a value for parameter type 'file'.getParamList(int id, int paramId) Selects a parameter value with type 'list'.getParamListCount(int id, int paramId) Selects a parameter value with type 'listcount'.getParamListCountWithTitles(int id, int paramId) Deprecated.getParamListWithComments(int id, int paramId) Selects a parameter value with type 'list' с комментариями значений.getParamListWithTitles(int id, int paramId) Deprecated.getParamListWithTitlesAndComments(int id, int paramId) Deprecated.getParamMoney(int id, int paramId) Selects a parameter value with type 'money'.getParamPhone(int id, int paramId) Selects a parameter value with type 'phone'.static ParameterPhoneValueItemgetParamText(int id, int paramId) Selects a value of parameter type 'text'.getParamTree(int id, int paramId) Selects a parameter value with type 'tree'.getParamTreeCount(int id, int paramId) Selects parameter values with type 'treecount'.getParamTreeWithTitles(int id, int paramId) Deprecated.booleanisParameterFilled(int id, Parameter param) Проверяет заполненость параметра для объекта с кодом id.loadParameters(List<Parameter> paramList, int id, boolean offEncryption) Loads parameter's values.voidobjectIdInvert(String objectType, int currentObjectId) Переносит параметры при с кода объекта на -код объекта.parameters(Id object) voidupdateParamAddress(int id, int paramId, int position, ParameterAddressValue value) Updates, appends and deletes an address parameter value.voidupdateParamBlob(int id, int paramId, String value) Updates value for parameter type 'blob'voidupdateParamDate(int id, int paramId, Date value) Updates value for parameter type 'date'voidupdateParamDateTime(int id, int paramId, Date value) Updates value for parameter type 'datetime'voidupdateParamEmail(int id, int paramId, int position, ParameterEmailValue value) Updates values for parameter type 'email'voidupdateParamEmail(int id, int paramId, List<ParameterEmailValue> values) Updates values for parameter type 'email'voidupdateParamFile(int id, int paramId, int position, String comment, FileData fileData) Deprecated.voidupdateParamFile(int id, int paramId, int position, FileData fileData) Updates values for parameter type 'file'voidupdateParamList(int id, int paramId, Map<Integer, String> values) Deprecated.voidupdateParamList(int id, int paramId, Set<Integer> values) Updates values without comments for parameter type 'list'voidupdateParamListCount(int id, int paramId, Map<Integer, ?> values) Updates values for parameter type 'listcount'voidupdateParamListCount(int id, int paramId, Map<Integer, Double> values, Map<Integer, String> valuesComments) Deprecated.voidupdateParamListWithComments(int id, int paramId, Map<Integer, String> values) Updates values with comments for parameter type 'list'voidupdateParamMoney(int id, int paramId, String value) Updates value for parameter type 'money'voidupdateParamMoney(int id, int paramId, BigDecimal value) Updates value for parameter type 'money'voidupdateParamPhone(int id, int paramId, ParameterPhoneValue value) Updates values for parameter type 'phone'voidupdateParamsAddressOnHouseUpdate(int houseId) Обновляет строки адресных параметров для дома.voidupdateParamText(int id, int paramId, String value) Updates value for parameter type 'text'voidupdateParamTree(int id, int paramId, Set<String> values) Updates values for parameter type 'tree'voidupdateParamTreeCount(int id, int paramId, Map<String, BigDecimal> values) Updates values for parameter type 'treecount'Methods inherited from class ru.bgcrm.dao.CommonDAOdeleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
- 
Field Details- 
TABLE_NAMES
- 
COPY_PARAMS_SEPARATORS- See Also:
 
 
- 
- 
Constructor Details- 
ParamValueDAO
- 
ParamValueDAO
 
- 
- 
Method Details- 
copyParampublic void copyParam(int fromObjectId, int toObjectId, int paramId) throws SQLException, BGException Копирует параметр с объекта на объект.- Parameters:
- fromObjectId- object ID исходного.
- toObjectId- object ID целевого.
- paramId- коды параметра.
- Throws:
- SQLException
- BGException
 
- 
copyParampublic void copyParam(int fromObjectId, int fromParamId, int toObjectId, int toParamId) throws SQLException, BGException Копирует параметр с объекта на объект. Параметры должны быть одного типа.- Parameters:
- fromObjectId- object ID исходного.
- fromParamId- param ID исходного.
- toObjectId- object ID целевого
- toParamId- param ID целевого.
- Throws:
- SQLException
- BGException
 
- 
copyParamspublic void copyParams(int fromObjectId, int toObjectId, String copyMapping) throws SQLException, BGException Копирует параметры с объекта на другой объект по указанной конфигурации.- Parameters:
- fromObjectId- исходный объект.
- toObjectId- целевой объект.
- copyMapping- конфигурация.
- Throws:
- SQLException
- BGException
 
- 
copyParamspublic void copyParams(int fromObjectId, int toObjectId, Collection<Integer> paramIds) throws SQLException, BGException Копирует параметры с объекта на объект- Parameters:
- fromObjectId- object ID исходного.
- toObjectId- object ID целевого.
- paramIds- коды параметров.
- Throws:
- SQLException
- BGException
 
- 
deleteParamsУдаляет параметры объекта.- Parameters:
- objectType- тип объекта.
- id- object ID
- Throws:
- SQLException
 
- 
getParamAddressВозвращает адресный параметр объекта.- Parameters:
- id- - код объекта.
- paramId- - param ID.
- position- - позиция, начиная от 1, если в параметре установлены несколько значений.
- Returns:
- Throws:
- SQLException
 
- 
getParamAddresspublic SortedMap<Integer,ParameterAddressValue> getParamAddress(int id, int paramId) throws SQLException Возвращает значения адресного параметра объекта.- Parameters:
- id- - код объекта.
- paramId- - param ID.
- Returns:
- ключ - позиция, значение - значение на позиции.
- Throws:
- SQLException
 
- 
getParamAddresspublic SortedMap<Integer,ParameterAddressValue> getParamAddress(int id, int paramId, boolean loadDirs) throws SQLException Возвращает значения адресного параметра объекта.- Parameters:
- id- - код объекта.
- paramId- - param ID.
- loadDirs- - признак необходимости загрузить справочники, чтобы был корректно заполнен- ParameterAddressValue.getHouse()/
- Returns:
- ключ - позиция, значение - значение на позиции.
- Throws:
- SQLException
 
- 
getParamAddresspublic SortedMap<Integer,ParameterAddressValue> getParamAddress(int id, int paramId, boolean loadDirs, String formatName) throws SQLException Возвращает значения адресного параметра объекта.- Parameters:
- id- - код объекта.
- paramId- - param ID.
- loadDirs- - признак необходимости загрузить справочники, чтобы был корректно заполнен- ParameterAddressValue.getHouse().
- formatName- - наименование формата адреса из конфигурации, с помощью которого форматировать значение адреса.
- Returns:
- ключ - позиция, значение - значение на позиции.
- Throws:
- SQLException
 
- 
getParamBlobSelects a value for parameter type 'blob'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamDateSelects a value for parameter type 'date'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamDateTimeSelects a value for parameter type 'datetime'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamEmailpublic SortedMap<Integer,ParameterEmailValue> getParamEmail(int id, int paramId) throws SQLException Selects values for parameter type 'email'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- key - param value position, value - a value itself.
- Throws:
- SQLException
 
- 
getParamFileSelects a value for parameter type 'file'.- Parameters:
- id- object ID
- paramId- param ID
- position- position number for multiple values.
- Returns:
- Throws:
- SQLException
 
- 
getParamFileSelects values for parameter type 'file'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- map with key equals value's position.
- Throws:
- SQLException
 
- 
getParamListSelects a parameter value with type 'list'.- Parameters:
- id- object ID
- paramId-
- Returns:
- Set с кодами значений.
- Throws:
- SQLException
 
- 
getParamListWithCommentsSelects a parameter value with type 'list' с комментариями значений.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- ключ - код значения, значение - комментарий.
- Throws:
- SQLException
 
- 
getParamListCountSelects a parameter value with type 'listcount'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- a map with key equals value IDs and values counts.
- Throws:
- SQLException
 
- 
getParamMoneySelects a parameter value with type 'money'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- the value or null.
- Throws:
- SQLException
 
- 
getParamPhoneSelects a parameter value with type 'phone'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- the value or null.
- Throws:
- SQLException
 
- 
getParamPhoneValueItemFromRspublic static ParameterPhoneValueItem getParamPhoneValueItemFromRs(ResultSet rs) throws SQLException - Throws:
- SQLException
 
- 
getParamTextSelects a value of parameter type 'text'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamTreeSelects a parameter value with type 'tree'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- набор значений.
- Throws:
- SQLException
 
- 
getParamTreeCountSelects parameter values with type 'treecount'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- map with a key equal to the parameter value ID, and the value - value amount (count).
- Throws:
- SQLException
 
- 
isParameterFilledПроверяет заполненость параметра для объекта с кодом id.- Parameters:
- id- object ID
- param- параметр.
- Returns:
- Throws:
- Exception
 
- 
objectIdInvertПереносит параметры при с кода объекта на -код объекта. Используется при преобразовании не созданного до конца процесса с отрицательным кодом в созданный.- Parameters:
- objectType-
- currentObjectId-
- Throws:
- SQLException
 
- 
parameters- Parameters:
- object- customer or process.
- Returns:
- Throws:
- SQLException
 
- 
updateParamAddresspublic void updateParamAddress(int id, int paramId, int position, ParameterAddressValue value) throws SQLException Updates, appends and deletes an address parameter value.- Parameters:
- id- - entity ID.
- paramId- - param ID.
- position- - starting from 1 value's position, 0 - appends a value with position MAX+1.
- value- - the value,- null- delete value from the position if- position> 0, else delete all the values.
- Throws:
- SQLException
 
- 
updateParamsAddressOnHouseUpdateОбновляет строки адресных параметров для дома. Используется после изменений в адресных справочников, для генерации корректных строк с адресными параметрами.- Parameters:
- houseId- код дома.
- Throws:
- SQLException
 
- 
updateParamBlobUpdates value for parameter type 'blob'- Parameters:
- id- object ID
- paramId- param ID
- value- значение, null или пустая строка - удалить значение.
- Throws:
- SQLException
 
- 
updateParamDateUpdates value for parameter type 'date'- Parameters:
- id- object ID
- paramId- param ID
- value- the value,- null- delete
- Throws:
- SQLException
 
- 
updateParamDateTimeUpdates value for parameter type 'datetime'- Parameters:
- id- object ID
- paramId- param ID
- value- the value,- null- delete
- Throws:
- SQLException
 
- 
updateParamEmailpublic void updateParamEmail(int id, int paramId, List<ParameterEmailValue> values) throws SQLException Updates values for parameter type 'email'- Parameters:
- id- object ID
- paramId- param ID
- values- the values,- nullor empty - delete values in DB
- Throws:
- SQLException
 
- 
updateParamEmailpublic void updateParamEmail(int id, int paramId, int position, ParameterEmailValue value) throws SQLException Updates values for parameter type 'email'- Parameters:
- id- object ID
- paramId- param ID
- position- values' position, starting from 1,- 0add a new value with position- MAX + 1
- value- the value,- nulldelete the values from the- positionmore than 0, delete all values if- positionis 0
- Throws:
- SQLException
 
- 
updateParamFileUpdates values for parameter type 'file'- Parameters:
- id- object ID
- paramId- param ID
- position- position for multiple values, when is 0 - adding with new positions
- fileData- value for the given position, if- null- removes a value from the position or all values with- position== -1
- Throws:
- Exception
 
- 
updateParamListUpdates values without comments for parameter type 'list'- Parameters:
- id- object ID
- paramId- param ID
- values- the values
- Throws:
- SQLException
 
- 
updateParamListWithCommentspublic void updateParamListWithComments(int id, int paramId, Map<Integer, String> values) throws SQLExceptionUpdates values with comments for parameter type 'list'- Parameters:
- id- object ID
- paramId- param ID
- values- the values map, keys represent values, values - comments
- Throws:
- SQLException
 
- 
updateParamListCountUpdates values for parameter type 'listcount'- Parameters:
- id- entity ID
- paramId- param ID
- values- map with key = value ID, and values with possible types:- String,- BigDecimal
- Throws:
- SQLException
 
- 
updateParamMoneyUpdates value for parameter type 'money'- Parameters:
- id- object ID
- paramId- param ID
- value- the value, when- null- delete
- Throws:
- SQLException
 
- 
updateParamMoneyUpdates value for parameter type 'money'- Parameters:
- id- object ID
- paramId- parm ID.
- value- the value, when- nullor a blank string - delete
- Throws:
- SQLException
 
- 
updateParamPhoneUpdates values for parameter type 'phone'- Parameters:
- id- object ID
- paramId- param ID
- value- the values,- nullor empty- itemList- delete values
- Throws:
- SQLException
 
- 
updateParamTextUpdates value for parameter type 'text'- Parameters:
- id- object ID
- paramId- param ID
- value- the value,- nullor emtpy string - delete value
- Throws:
- SQLException
 
- 
updateParamTreeUpdates values for parameter type 'tree'- Parameters:
- id- object ID
- paramId- param ID
- values- the values,- nullor empty set - delete values
- Throws:
- SQLException
 
- 
updateParamTreeCountpublic void updateParamTreeCount(int id, int paramId, Map<String, BigDecimal> values) throws SQLExceptionUpdates values for parameter type 'treecount'- Parameters:
- id- object ID
- paramId- param ID
- values- the values map (key - treecount value ID, value - 'count'),- nullor emtpy map - delete values
- Throws:
- SQLException
 
- 
loadParameterspublic List<ParameterValue> loadParameters(List<Parameter> paramList, int id, boolean offEncryption) throws SQLException Loads parameter's values.- Parameters:
- paramList- parameters list.
- id- entity id.
- offEncryption- decrypt pseudo encrypted values.
- Throws:
- SQLException
 
- 
getParamEmail@Deprecated public ParameterEmailValue getParamEmail(int id, int paramId, int position) throws SQLException Deprecated.Selects a value for parameter type 'email'.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamListWithTitlesDeprecated.Selects a parameter value with type 'list' с наименованиями значений.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamListWithTitlesAndComments@Deprecated public List<IdTitleComment> getParamListWithTitlesAndComments(int id, int paramId) throws SQLException Deprecated.Selects a parameter value with type 'list' с наименованиями значений и примечаниями.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamListCountWithTitles@Deprecated public List<IdTitle> getParamListCountWithTitles(int id, int paramId) throws SQLException Deprecated.Selects a parameter value with type 'listcount' с наименованиями значений.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
getParamTreeWithTitles@Deprecated public List<IdStringTitle> getParamTreeWithTitles(int id, int paramId) throws SQLException Deprecated.Значения параметра объекта типа 'tree' с текстовыми наименованиями.- Parameters:
- id- object ID
- paramId- param ID
- Returns:
- Throws:
- SQLException
 
- 
updateParamFile@Deprecated public void updateParamFile(int id, int paramId, int position, String comment, FileData fileData) throws Exception Deprecated.- Throws:
- Exception
 
- 
updateParamList@Deprecated public void updateParamList(int id, int paramId, Map<Integer, String> values) throws SQLExceptionDeprecated.- Throws:
- SQLException
 
- 
updateParamListCount@Deprecated public void updateParamListCount(int id, int paramId, Map<Integer, Double> values, Map<Integer, throws SQLExceptionString> valuesComments) Deprecated.ИспользоватьupdateParamListCount(int, int, Map).- Throws:
- SQLException
 
 
-