From bfcb41213b60a0fabd83265cfbbc16c03f9a2e91 Mon Sep 17 00:00:00 2001 From: Johannes Hoermann <j.hoermann@adito.de> Date: Tue, 19 Feb 2019 08:14:38 +0100 Subject: [PATCH] Fixes, TODOs, refactorings --- .../entityfields/image/onValueChange.js | 2 +- .../standard_email_comm/onValueChange.js | 2 +- .../standard_phone_comm/onValueChange.js | 2 +- .../recordcontainers/db/onDBUpdate.js | 2 +- entity/Task_entity/onValidation.js | 3 +- .../expression.js | 2 +- .../expression.js | 2 +- entity/Turnover_entity/Turnover_entity.aod | 33 +++++++++ entity/Turnover_entity/documentation.adoc | 3 + .../entityfields/maxyear_param/code.js | 5 ++ .../maxyear_param/documentation.adoc | 3 + .../yearcounttoshow_param/code.js | 3 + .../yearcounttoshow_param/documentation.adoc | 3 + .../recordcontainers/jdito/contentProcess.js | 10 ++- .../_____LANGUAGE_EXTRA.aod | 12 ++++ .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 14 ++++ .../_____LANGUAGE_en/_____LANGUAGE_en.aod | 14 ++++ process/IndexSearch_lib/process.js | 2 + process/Offer_lib/process.js | 2 +- process/Person_lib/process.js | 2 +- process/Product_lib/process.js | 4 +- process/Sql_lib/process.js | 69 ++++++++++--------- 22 files changed, 147 insertions(+), 47 deletions(-) create mode 100644 entity/Turnover_entity/documentation.adoc create mode 100644 entity/Turnover_entity/entityfields/maxyear_param/code.js create mode 100644 entity/Turnover_entity/entityfields/maxyear_param/documentation.adoc create mode 100644 entity/Turnover_entity/entityfields/yearcounttoshow_param/code.js create mode 100644 entity/Turnover_entity/entityfields/yearcounttoshow_param/documentation.adoc diff --git a/entity/Organisation_entity/entityfields/image/onValueChange.js b/entity/Organisation_entity/entityfields/image/onValueChange.js index f7fffb124f..86a4f85653 100644 --- a/entity/Organisation_entity/entityfields/image/onValueChange.js +++ b/entity/Organisation_entity/entityfields/image/onValueChange.js @@ -1,4 +1,4 @@ import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.IMAGE"); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/standard_email_comm/onValueChange.js b/entity/Organisation_entity/entityfields/standard_email_comm/onValueChange.js index 25c5a67ac8..972cb181d5 100644 --- a/entity/Organisation_entity/entityfields/standard_email_comm/onValueChange.js +++ b/entity/Organisation_entity/entityfields/standard_email_comm/onValueChange.js @@ -1,4 +1,4 @@ import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.STANDARD_EMAIL_COMMUNICATION"); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/standard_phone_comm/onValueChange.js b/entity/Organisation_entity/entityfields/standard_phone_comm/onValueChange.js index fd9905c4cd..991c92d38d 100644 --- a/entity/Organisation_entity/entityfields/standard_phone_comm/onValueChange.js +++ b/entity/Organisation_entity/entityfields/standard_phone_comm/onValueChange.js @@ -1,4 +1,4 @@ import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.STANDARD_PHONE_COMMUNICATION"); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js b/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js index 38981a5ca0..d9103a1d89 100644 --- a/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js @@ -3,7 +3,7 @@ import("Organisation_lib"); import("Communication_lib"); import("Entity_lib"); -// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Container +// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Container #1030023 FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function(state, value){ if (state == FieldChanges.STATE_CHANGED()) OrgUtils.setImage(vars.get("$field.ORGANISATIONID"), value); diff --git a/entity/Task_entity/onValidation.js b/entity/Task_entity/onValidation.js index f0f501340b..460d1e2fc9 100644 --- a/entity/Task_entity/onValidation.js +++ b/entity/Task_entity/onValidation.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.db"); import("system.vars"); import("system.text"); @@ -11,6 +12,6 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) var newCodeNumber = db.cell("select " + maskingHelper.max("TASK.CODE") + " from TASK"); newCodeNumber = Number(newCodeNumber);//if no number exists till no, start value will be 1 (due to: ++0) if (isNaN(newCodeNumber)) - throw new TypeError();//TODO:add Message + throw new TypeError(translate.text("The code number is not a valid number.")); neon.setFieldValue("$field.CODE", ++newCodeNumber); } \ No newline at end of file diff --git a/entity/Task_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js b/entity/Task_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js index 62f1b9375d..e5961584dd 100644 --- a/entity/Task_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js +++ b/entity/Task_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js @@ -1,6 +1,6 @@ import("system.result"); import("Person_lib"); -//TODO: try to find a better solution for this +//TODO: try to find a better solution for this -> #TITLE-mechanic when available var subSql = PersUtils.getResolvingDisplaySubSql("TASK.EDITOR_CONTACT_ID"); result.string(subSql); \ No newline at end of file diff --git a/entity/Task_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js b/entity/Task_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js index b29b24d836..6c6d6087a2 100644 --- a/entity/Task_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js +++ b/entity/Task_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js @@ -1,6 +1,6 @@ import("system.result"); import("Person_lib"); -//TODO: try to find a better solution for this +//TODO: try to find a better solution for this -> #TITLE-mechanic when available var subSql = PersUtils.getResolvingDisplaySubSql("TASK.REQUESTOR_CONTACT_ID"); result.string(subSql); \ No newline at end of file diff --git a/entity/Turnover_entity/Turnover_entity.aod b/entity/Turnover_entity/Turnover_entity.aod index c3370b42a6..193ddaf48a 100644 --- a/entity/Turnover_entity/Turnover_entity.aod +++ b/entity/Turnover_entity/Turnover_entity.aod @@ -3,6 +3,7 @@ <name>Turnover_entity</name> <title>Turnover</title> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/Turnover_entity/documentation.adoc</documentation> <iconId>VAADIN:CHART</iconId> <recordContainer>jdito</recordContainer> <entityFields> @@ -31,6 +32,38 @@ <title>Year</title> <contentType>TEXT</contentType> </entityField> + <entityParameter> + <name>YearCountToShow_param</name> + <code>%aditoprj%/entity/Turnover_entity/entityfields/yearcounttoshow_param/code.js</code> + <expose v="true" /> + <triggerRecalculation v="true" /> + <mandatory v="false" /> + <documentation>%aditoprj%/entity/Turnover_entity/entityfields/yearcounttoshow_param/documentation.adoc</documentation> + <description>PARAMETER</description> + </entityParameter> + <entityParameter> + <name>MaxYear_param</name> + <code>%aditoprj%/entity/Turnover_entity/entityfields/maxyear_param/code.js</code> + <expose v="true" /> + <triggerRecalculation v="true" /> + <mandatory v="false" /> + <documentation>%aditoprj%/entity/Turnover_entity/entityfields/maxyear_param/documentation.adoc</documentation> + <description>PARAMETER</description> + </entityParameter> + <entityProvider> + <name>FilteredTurnover</name> + <fieldType>DEPENDENCY_IN</fieldType> + <children> + <entityParameter> + <name>MaxYear_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>YearCountToShow_param</name> + <expose v="true" /> + </entityParameter> + </children> + </entityProvider> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Turnover_entity/documentation.adoc b/entity/Turnover_entity/documentation.adoc new file mode 100644 index 0000000000..cfd1007050 --- /dev/null +++ b/entity/Turnover_entity/documentation.adoc @@ -0,0 +1,3 @@ +== Turnover == + +This entity provides charts to display the Turnover. \ No newline at end of file diff --git a/entity/Turnover_entity/entityfields/maxyear_param/code.js b/entity/Turnover_entity/entityfields/maxyear_param/code.js new file mode 100644 index 0000000000..652de6453d --- /dev/null +++ b/entity/Turnover_entity/entityfields/maxyear_param/code.js @@ -0,0 +1,5 @@ +import("system.result"); +import("system.vars"); +import("system.datetime"); + +result.string(datetime.toDate(vars.get("$sys.date"), "yyyy")); \ No newline at end of file diff --git a/entity/Turnover_entity/entityfields/maxyear_param/documentation.adoc b/entity/Turnover_entity/entityfields/maxyear_param/documentation.adoc new file mode 100644 index 0000000000..fcbd74f60e --- /dev/null +++ b/entity/Turnover_entity/entityfields/maxyear_param/documentation.adoc @@ -0,0 +1,3 @@ +this parameter is for setting the maximum year to show. + +The default is the current year. \ No newline at end of file diff --git a/entity/Turnover_entity/entityfields/yearcounttoshow_param/code.js b/entity/Turnover_entity/entityfields/yearcounttoshow_param/code.js new file mode 100644 index 0000000000..02fc6e39eb --- /dev/null +++ b/entity/Turnover_entity/entityfields/yearcounttoshow_param/code.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("4"); \ No newline at end of file diff --git a/entity/Turnover_entity/entityfields/yearcounttoshow_param/documentation.adoc b/entity/Turnover_entity/entityfields/yearcounttoshow_param/documentation.adoc new file mode 100644 index 0000000000..a0783738ca --- /dev/null +++ b/entity/Turnover_entity/entityfields/yearcounttoshow_param/documentation.adoc @@ -0,0 +1,3 @@ +This parameter is for setting the number of years to show. + +Default is 4. \ No newline at end of file diff --git a/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js b/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js index 8336cb91b4..5953c63179 100644 --- a/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,5 @@ +import("system.vars"); +import("system.logging"); import("system.datetime"); import("system.db"); import("system.result"); @@ -18,11 +20,13 @@ var chartData = ReferencingData.begin(rootNode); var skippedCounts = {}; - -for (let i = 0; i < 4; i++) +var maxYear = parseInt(vars.get("$param.MaxYear_param")); +var yearCountToShow = parseInt(vars.get("$param.YearCountToShow_param")); + +for (let i = 0; i < yearCountToShow; i++) { // TODO: currently years are hardcoded. - var year = i + 2016; + var year = i + maxYear - yearCountToShow + 1; var TurnoverYearSum = 0; var ForecastYearSum = 0; diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index a9229f2893..6d07ea7105 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -2331,6 +2331,18 @@ <entry> <key>Linktype</key> </entry> + <entry> + <key>${SQL_LIB_UNSUPPORTED_DBTYPE} function: %0</key> + </entry> + <entry> + <key>Links</key> + </entry> + <entry> + <key>Linktype</key> + </entry> + <entry> + <key>${PRODUCT_LIB_NO_PRODUCT_ID} function: %0</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 0959f7869c..f18b405fac 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -2686,6 +2686,20 @@ <entry> <key>Linktype</key> </entry> + <entry> + <key>${SQL_LIB_UNSUPPORTED_DBTYPE} function: %0</key> + <value>Der DB-Typ wird in der Funktion %0 nicht unterstützt.</value> + </entry> + <entry> + <key>Links</key> + </entry> + <entry> + <key>Linktype</key> + </entry> + <entry> + <key>${PRODUCT_LIB_NO_PRODUCT_ID} function: %0</key> + <value>Es wird der Funktion %0 keine Produktid übergeben.</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 5d720094ac..78ad4e2a7e 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -2353,6 +2353,20 @@ <entry> <key>Linktype</key> </entry> + <entry> + <key>${SQL_LIB_UNSUPPORTED_DBTYPE} function: %0</key> + <value>The DBTYPE is not supported by function %0.</value> + </entry> + <entry> + <key>Links</key> + </entry> + <entry> + <key>Linktype</key> + </entry> + <entry> + <key>${PRODUCT_LIB_NO_PRODUCT_ID} function: %0</key> + <value>Missing productId in function %0.</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/process/IndexSearch_lib/process.js b/process/IndexSearch_lib/process.js index 17652ebfbf..b39ce87ed0 100644 --- a/process/IndexSearch_lib/process.js +++ b/process/IndexSearch_lib/process.js @@ -5,6 +5,8 @@ import("system.text"); * provides static methods for special handling of entities in JDito-Processes * do not create an instance of this * + * TODO: lib has to be updated with new Indexsearch when it is available + * * @class */ function IndexsearchUtils() {} diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 41cadea985..9078239b37 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -228,7 +228,7 @@ OfferUtils.openOfferReport = function(pOfferID) "OFFERDel" : "" //getKeyName(rptdata[0][4] , "DELIVERYTERMS", "KEYNAME1", language); }; - // TODO: implementieren wenn Attribute m�glich sind + // TODO: implementieren wenn Attribute möglich sind var adma = "" /*var adm = getAddressData( [GetAttributeKey( "Aussendienst", "1", orgrelid, pUser )[0]], [["Person","function", "concat( ['SALUTATION', 'TITLE', 'FIRSTNAME','LASTNAME'])"], diff --git a/process/Person_lib/process.js b/process/Person_lib/process.js index cf9ec53403..c5ad5751f5 100644 --- a/process/Person_lib/process.js +++ b/process/Person_lib/process.js @@ -56,7 +56,7 @@ PersUtils.removeImage = function(pPersId) PersUtils.getResolvingDisplaySubSql = function(pRelationIdField) { var maskingHelper = new SqlMaskingUtils(); - //TODO: verify if there is a better solution for the usage of this as a displayValueExpression + //TODO: verify if there is a better solution for the usage of this as a displayValueExpression --> automatic use of #TITLE return "select " + maskingHelper.concat(["PERSON.FIRSTNAME", "PERSON.LASTNAME"]) + "from PERSON \n\ join CONTACT on (PERSON.PERSONID = CONTACT.PERSON_ID) \n\ where CONTACT.CONTACTID = " + pRelationIdField; diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index 0d183d8d40..217d65e532 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -35,7 +35,7 @@ ProductUtils.getCurrentProductPrice = function(pid, buySell) { var actualPriceCondition = SqlCondition.begin() .andPrepare("PRODUCTPRICE.BUYSELL", buySell) .andPrepare("PRODUCTPRICE.PRODUCT_ID", pid) - .andPrepare("PRODUCTPRICE.CURRENCY", 1) // TODO: warum ist Currency hardgecoded auf 1?? + .andPrepare("PRODUCTPRICE.CURRENCY", 1) // TODO: warum ist Currency hardgecoded auf 1?? --> Einheitliche Währungen einbauen (auch zeichen vor oder nach der zahel, etc.) .andPrepare("PRODUCTPRICE.VALID_FROM", today, "# <= ?") .andSqlCondition(SqlCondition.begin() .orPrepare("PRODUCTPRICE.VALID_TO", today, "# >= ?") @@ -76,7 +76,7 @@ ProductUtils.getStockCount = function(pid) { } else { - throw new Error();//TODO: add message + throw new Error(translate.withArguments("${PRODUCT_LIB_NO_PRODUCT_ID} function: %0", ["ProductUtils.getStockCount"])); } } diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 50d0d7ba39..05a07d2c9a 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -17,14 +17,16 @@ import("Util_lib"); * * @class * @param {String} [alias=the current alias] the database alias where the condition shall be executed later (important for column types of preparedStatements) - * @example //TODO: add missing example + * @example + * see others/guide/HowToSqlConditionLib.adoc */ function SqlCondition(alias) { - //setting null is only needed to provide autocomplete for the ADITO-designer + // setting null is only needed to provide autocomplete for the ADITO-designer this.preparedValues = null; - this._init();//the properties are initalized in an extra function because init is nearly the same as resetting (clearing) the SqlConditions + this._init(); // the properties are initalized in an extra function because init is nearly the same as resetting (clearing) the SqlConditions this.alias = alias; - this._cachedTypes = {}; + + // save, if the last condition was an OR. For better bracket-placement this._lastWasOr = false; } @@ -535,8 +537,8 @@ SqlMaskingUtils.prototype.max = function(field) } /** -* returns the min-value sql expressions depending on the database behind the given alias -* note that this function does not verifiy if the field (and type) usage is valid at all +* returns the min-value sql expressions depending on the database behind the given alias +* note that this function does not verifiy if the field (and type) usage is valid at all * * @param {String} field expression * @@ -548,36 +550,38 @@ SqlMaskingUtils.prototype.min = function(field) } /** - * masks the function cast of standard sql - * please note that this function does not do any validation if it's possible to cast the expression's datatype you pass to the function in every supported DBMS - * - * @param {String} field name of the database field that shall be castet - * @param {String} [targetDatatype] a SQLTYPES-value of the following: SQLTYPES.CHAR, SQLTYPES.VARCHAR, SQLTYPES.INTEGER, - * SQLTYPES.DECIMAL, SQLTYPES.DATE - * @param {int|int[]} targetLength specifies the length of the target data type; - * <br/>- char/varchar: length - * <br/>- decimal: [length, decimals] - * - * @return {String} sql part to be included in sql-statements - */ + * masks the function cast of standard sql + * please note that this function does not do any validation if it's possible to cast the expression's datatype you pass to the function in every supported DBMS + * + * Problems: + * Derby has problems with casting to CHAR({> 254}) https://db.apache.org/derby/docs/10.14/ref/rrefsqlj13733.html + * + * @param {String} field name of the database field that shall be castet + * @param {String} [targetDatatype] a SQLTYPES-value of the following: SQLTYPES.CHAR, SQLTYPES.VARCHAR, SQLTYPES.INTEGER, + * SQLTYPES.DECIMAL, SQLTYPES.DATE + * @param {int|int[]} targetLength specifies the length of the target data type; + * <br/>- char/varchar: length + * <br/>- decimal: [length, decimals] + * + * @return {String} sql part to be included in sql-statements + */ SqlMaskingUtils.prototype.cast = function (field, targetDatatype, targetLength) { - //TODO: use callbacks for different handling? /* Some informations if you want to add supported databaseTypes or dataTypes: - * You should consider using the _mapDefaults function-expression (details in the functions doc) - * However you shouldn't use the function in a "default"-Block of a switch-case because of the following behaviour: - * If a datatype is not supported you just have to NOT specify "sqlDataType" (leave it "undefined") -> an error is then raised - * Therefore you should explicitly define which Data-type is supported and which is not - */ + * You should consider using the _mapDefaults function-expression (details in the functions doc) + * However you shouldn't use the function in a "default"-Block of a switch-case because of the following behaviour: + * If a datatype is not supported you just have to NOT specify "sqlDataType" (leave it "undefined") -> an error is then raised + * Therefore you should explicitly define which Data-type is supported and which is not + */ var dbType, functionName, sqlPart, sqlDataType, _mapDefaults; dbType = this.dbType; functionName = "cast";//overwrite this in the "switch (dbType)" if needed with your DBMS /** - * handles default-scenarios for mapping input-targetDatatype to a string for a sql-statement - * e.g. SQLTYPES.INTEGER --> int - * @param {Number} dataType input as a value of "SQLTYPES." that will be mapped to a string - * @return {String} the mapped dataType for using in a sql-statement - */ + * handles default-scenarios for mapping input-targetDatatype to a string for a sql-statement + * e.g. SQLTYPES.INTEGER --> int + * @param {Number} dataType input as a value of "SQLTYPES." that will be mapped to a string + * @return {String} the mapped dataType for using in a sql-statement + */ _mapDefaults = function (dataType) { var res; switch(dataType) { @@ -611,7 +615,6 @@ SqlMaskingUtils.prototype.cast = function (field, targetDatatype, targetLength) sqlDataType = "varchar"; break; case SQLTYPES.CHAR: - //TODO: throw error if(targetLength > 254)? https://db.apache.org/derby/docs/10.14/ref/rrefsqlj13733.html sqlDataType = "char"; break; case SQLTYPES.DECIMAL: @@ -678,7 +681,7 @@ SqlMaskingUtils.prototype.cast = function (field, targetDatatype, targetLength) } if (sqlDataType == undefined) { - throw new Error("sqlDataType is undefined");//TODO: add usefull message + throw new Error(translate.withArguments("${SQL_LIB_UNSUPPORTED_DBTYPE} function: %0", ["SqlMaskingUtils.prototype.cast._mapDefaults"])); } if(targetLength == undefined) @@ -779,7 +782,7 @@ SqlMaskingUtils.prototype.substring = function(field, start, length) { sqlFnName = "substring"; break; default: - throw new Error();//ToDo: add message + throw new Error(translate.withArguments("${SQL_LIB_UNSUPPORTED_DBTYPE} function: %0", ["SqlMaskingUtils.prototype.substring"])); } return sqlFnName + "(" + field + ", " + start + ", " + length + ")"; @@ -833,7 +836,7 @@ SqlMaskingUtils.prototype.concat = function(fields, separatorCharacter, autoTrim case db.DBTYPE_DERBY10: break; default: - throw new Error();//TODO: add Message + throw new Error(translate.withArguments("${SQL_LIB_UNSUPPORTED_DBTYPE} function: %0", ["SqlMaskingUtils.prototype.concat"])); } separatorSql = concatSql + "'" + separatorSql + "'"; _trimIfAutoTrimEnabled = function(f){ -- GitLab