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 Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id> -
Field Summary
FieldsFields inherited from class ru.bgcrm.dao.CommonDAO
con, 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
ConstructorsConstructorDescriptionParamValueDAO(Connection con) ParamValueDAO(Connection con, boolean history, int userId) -
Method Summary
Modifier 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.CommonDAO
deleteById, 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
-
copyParam
public void copyParam(int fromObjectId, int toObjectId, int paramId) throws SQLException, BGException Копирует параметр с объекта на объект.- Parameters:
fromObjectId- object ID исходного.toObjectId- object ID целевого.paramId- коды параметра.- Throws:
SQLExceptionBGException
-
copyParam
public 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:
SQLExceptionBGException
-
copyParams
public void copyParams(int fromObjectId, int toObjectId, String copyMapping) throws SQLException, BGException Копирует параметры с объекта на другой объект по указанной конфигурации.- Parameters:
fromObjectId- исходный объект.toObjectId- целевой объект.copyMapping- конфигурация.- Throws:
SQLExceptionBGException
-
copyParams
public void copyParams(int fromObjectId, int toObjectId, Collection<Integer> paramIds) throws SQLException, BGException Копирует параметры с объекта на объект- Parameters:
fromObjectId- object ID исходного.toObjectId- object ID целевого.paramIds- коды параметров.- Throws:
SQLExceptionBGException
-
deleteParams
Удаляет параметры объекта.- Parameters:
objectType- тип объекта.id- object ID- Throws:
SQLException
-
getParamAddress
Возвращает адресный параметр объекта.- Parameters:
id- - код объекта.paramId- - param ID.position- - позиция, начиная от 1, если в параметре установлены несколько значений.- Returns:
- Throws:
SQLException
-
getParamAddress
public SortedMap<Integer,ParameterAddressValue> getParamAddress(int id, int paramId) throws SQLException Возвращает значения адресного параметра объекта.- Parameters:
id- - код объекта.paramId- - param ID.- Returns:
- ключ - позиция, значение - значение на позиции.
- Throws:
SQLException
-
getParamAddress
public SortedMap<Integer,ParameterAddressValue> getParamAddress(int id, int paramId, boolean loadDirs) throws SQLException Возвращает значения адресного параметра объекта.- Parameters:
id- - код объекта.paramId- - param ID.loadDirs- - признак необходимости загрузить справочники, чтобы был корректно заполненParameterAddressValue.getHouse()/- Returns:
- ключ - позиция, значение - значение на позиции.
- Throws:
SQLException
-
getParamAddress
public 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
-
getParamBlob
Selects a value for parameter type 'blob'.- Parameters:
id- object IDparamId- param ID- Returns:
- Throws:
SQLException
-
getParamDate
Selects a value for parameter type 'date'.- Parameters:
id- object IDparamId- param ID- Returns:
- Throws:
SQLException
-
getParamDateTime
Selects a value for parameter type 'datetime'.- Parameters:
id- object IDparamId- param ID- Returns:
- Throws:
SQLException
-
getParamEmail
public SortedMap<Integer,ParameterEmailValue> getParamEmail(int id, int paramId) throws SQLException Selects values for parameter type 'email'.- Parameters:
id- object IDparamId- param ID- Returns:
- key - param value position, value - a value itself.
- Throws:
SQLException
-
getParamFile
Selects a value for parameter type 'file'.- Parameters:
id- object IDparamId- param IDposition- position number for multiple values.- Returns:
- Throws:
SQLException
-
getParamFile
Selects values for parameter type 'file'.- Parameters:
id- object IDparamId- param ID- Returns:
- map with key equals value's position.
- Throws:
SQLException
-
getParamList
Selects a parameter value with type 'list'.- Parameters:
id- object IDparamId-- Returns:
- Set с кодами значений.
- Throws:
SQLException
-
getParamListWithComments
Selects a parameter value with type 'list' с комментариями значений.- Parameters:
id- object IDparamId- param ID- Returns:
- ключ - код значения, значение - комментарий.
- Throws:
SQLException
-
getParamListCount
Selects a parameter value with type 'listcount'.- Parameters:
id- object IDparamId- param ID- Returns:
- a map with key equals value IDs and values counts.
- Throws:
SQLException
-
getParamMoney
Selects a parameter value with type 'money'.- Parameters:
id- object IDparamId- param ID- Returns:
- the value or
null. - Throws:
SQLException
-
getParamPhone
Selects a parameter value with type 'phone'.- Parameters:
id- object IDparamId- param ID- Returns:
- the value or
null. - Throws:
SQLException
-
getParamPhoneValueItemFromRs
public static ParameterPhoneValueItem getParamPhoneValueItemFromRs(ResultSet rs) throws SQLException - Throws:
SQLException
-
getParamText
Selects a value of parameter type 'text'.- Parameters:
id- object IDparamId- param ID- Returns:
- Throws:
SQLException
-
getParamTree
Selects a parameter value with type 'tree'.- Parameters:
id- object IDparamId- param ID- Returns:
- набор значений.
- Throws:
SQLException
-
getParamTreeCount
Selects parameter values with type 'treecount'.- Parameters:
id- object IDparamId- 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 IDparam- параметр.- Returns:
- Throws:
Exception
-
objectIdInvert
Переносит параметры при с кода объекта на -код объекта. Используется при преобразовании не созданного до конца процесса с отрицательным кодом в созданный.- Parameters:
objectType-currentObjectId-- Throws:
SQLException
-
parameters
- Parameters:
object- customer or process.- Returns:
- Throws:
SQLException
-
updateParamAddress
public 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 ifposition> 0, else delete all the values.- Throws:
SQLException
-
updateParamsAddressOnHouseUpdate
Обновляет строки адресных параметров для дома. Используется после изменений в адресных справочников, для генерации корректных строк с адресными параметрами.- Parameters:
houseId- код дома.- Throws:
SQLException
-
updateParamBlob
Updates value for parameter type 'blob'- Parameters:
id- object IDparamId- param IDvalue- значение, null или пустая строка - удалить значение.- Throws:
SQLException
-
updateParamDate
Updates value for parameter type 'date'- Parameters:
id- object IDparamId- param IDvalue- the value,null- delete- Throws:
SQLException
-
updateParamDateTime
Updates value for parameter type 'datetime'- Parameters:
id- object IDparamId- param IDvalue- the value,null- delete- Throws:
SQLException
-
updateParamEmail
public void updateParamEmail(int id, int paramId, List<ParameterEmailValue> values) throws SQLException Updates values for parameter type 'email'- Parameters:
id- object IDparamId- param IDvalues- the values,nullor empty - delete values in DB- Throws:
SQLException
-
updateParamEmail
public void updateParamEmail(int id, int paramId, int position, ParameterEmailValue value) throws SQLException Updates values for parameter type 'email'- Parameters:
id- object IDparamId- param IDposition- values' position, starting from 1,0add a new value with positionMAX + 1value- the value,nulldelete the values from thepositionmore than 0, delete all values ifpositionis 0- Throws:
SQLException
-
updateParamFile
Updates values for parameter type 'file'- Parameters:
id- object IDparamId- param IDposition- position for multiple values, when is 0 - adding with new positionsfileData- value for the given position, ifnull- removes a value from the position or all values withposition== -1- Throws:
Exception
-
updateParamList
Updates values without comments for parameter type 'list'- Parameters:
id- object IDparamId- param IDvalues- the values- Throws:
SQLException
-
updateParamListWithComments
public void updateParamListWithComments(int id, int paramId, Map<Integer, String> values) throws SQLExceptionUpdates values with comments for parameter type 'list'- Parameters:
id- object IDparamId- param IDvalues- the values map, keys represent values, values - comments- Throws:
SQLException
-
updateParamListCount
Updates values for parameter type 'listcount'- Parameters:
id- entity IDparamId- param IDvalues- map with key = value ID, and values with possible types:String,BigDecimal- Throws:
SQLException
-
updateParamMoney
Updates value for parameter type 'money'- Parameters:
id- object IDparamId- param IDvalue- the value, whennull- delete- Throws:
SQLException
-
updateParamMoney
Updates value for parameter type 'money'- Parameters:
id- object IDparamId- parm ID.value- the value, whennullor a blank string - delete- Throws:
SQLException
-
updateParamPhone
Updates values for parameter type 'phone'- Parameters:
id- object IDparamId- param IDvalue- the values,nullor emptyitemList- delete values- Throws:
SQLException
-
updateParamText
Updates value for parameter type 'text'- Parameters:
id- object IDparamId- param IDvalue- the value,nullor emtpy string - delete value- Throws:
SQLException
-
updateParamTree
Updates values for parameter type 'tree'- Parameters:
id- object IDparamId- param IDvalues- the values,nullor empty set - delete values- Throws:
SQLException
-
updateParamTreeCount
public void updateParamTreeCount(int id, int paramId, Map<String, BigDecimal> values) throws SQLExceptionUpdates values for parameter type 'treecount'- Parameters:
id- object IDparamId- param IDvalues- the values map (key - treecount value ID, value - 'count'),nullor emtpy map - delete values- Throws:
SQLException
-
loadParameters
public 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 IDparamId- param ID- Returns:
- Throws:
SQLException
-
getParamListWithTitles
Deprecated.Selects a parameter value with type 'list' с наименованиями значений.- Parameters:
id- object IDparamId- 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 IDparamId- 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 IDparamId- param ID- Returns:
- Throws:
SQLException
-
getParamTreeWithTitles
@Deprecated public List<IdStringTitle> getParamTreeWithTitles(int id, int paramId) throws SQLException Deprecated.Значения параметра объекта типа 'tree' с текстовыми наименованиями.- Parameters:
id- object IDparamId- 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
-