From 37715367898610ede50e5cc2cc8d6eba391ddaa8 Mon Sep 17 00:00:00 2001 From: Johannes Hoermann <j.hoermann@adito.de> Date: Wed, 21 Nov 2018 14:11:11 +0100 Subject: [PATCH] SQL lib improved, salesproject fixed --- aliasDefinition/Data_alias/Data_alias.aod | 333 ++++++++---------- .../relationsmaincountry_param/code.js | 2 +- entity/History_entity/conditionProcess.js | 2 +- entity/Offer_entity/conditionProcess.js | 2 +- entity/Pers_entity/conditionProcess.js | 2 +- .../children/relid_param/code.js | 2 +- .../conditionProcess.js | 2 +- .../conditionProcess.js | 2 +- .../conditionProcess.js | 2 +- .../conditionProcess.js | 2 +- .../conditionProcess.js | 2 +- .../entityfields/projectcode/onValidation.js | 2 +- .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 1 + others/db_changes/masterChangelog.xml | 6 + process/Sql_lib/process.js | 26 +- 15 files changed, 173 insertions(+), 215 deletions(-) diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 66cadb14b0f..b61203d40a2 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -2131,194 +2131,6 @@ </entityFieldDb> </entityFields> </entityDb> - <entityDb> - <name>COUNTRYINFO</name> - <dbName></dbName> - <idColumn>ISO2</idColumn> - <idGeneratorType v="0" /> - <idGeneratorInterval v="1" /> - <title></title> - <description></description> - <auditSyncConfig> - <name>auditSyncConfig</name> - <auditMode v="0" /> - <syncActive v="false" /> - <syncComplete v="true" /> - <syncDirection v="1" /> - <syncIds></syncIds> - </auditSyncConfig> - <entityFields> - <entityFieldDb> - <name>FLAGICON</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="2004" /> - <size v="2147483647" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>ZIP_EXISTS</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="1" /> - <size v="1" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>EUROZONE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="1" /> - <size v="1" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>ISO3</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="1" /> - <size v="3" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>CURRENCYCODE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="1" /> - <size v="3" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>ISO2</name> - <dbName></dbName> - <primaryKey v="true" /> - <columnType v="1" /> - <size v="2" /> - <scale v="0" /> - <notNull v="true" /> - <isUnique v="true" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>CURRENCYNAME_DE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="12" /> - <size v="50" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>DEFAULTLANGUAGE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="12" /> - <size v="5" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>DIALPREFIX</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="1" /> - <size v="5" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>POBOXNAME</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="12" /> - <size v="30" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>EUMEMBER</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="1" /> - <size v="1" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>NAME_DE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="12" /> - <size v="100" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - <entityFieldDb> - <name>ADDRFORMAT</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="12" /> - <size v="250" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> - </entityFields> - </entityDb> <entityDb> <name>OFFER</name> <dbName></dbName> @@ -3861,6 +3673,151 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>SALESPROJECT_CLASSIFICATION</name> + <dbName></dbName> + <idColumn>SALESPROJECT_CLASSIFICATIONID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>DATE_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>KEYWORD</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>SALESPROJECT_CLASSIFICATIONID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CLASS</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="1" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>VALUE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>SALESPROJECT_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> </entities> </entityGroup> </aliasDefDb> diff --git a/entity/Comm_entity/entityfields/relationsmaincountry_param/code.js b/entity/Comm_entity/entityfields/relationsmaincountry_param/code.js index 54f08b035b6..7a2a8594ddc 100644 --- a/entity/Comm_entity/entityfields/relationsmaincountry_param/code.js +++ b/entity/Comm_entity/entityfields/relationsmaincountry_param/code.js @@ -8,6 +8,6 @@ cond = new SqlCondition(); cond.andPrepareVars("RELATION.RELATIONID", "$param.RelId_param"); //TODO: this should happen by 1:1 links instead of manually requesting the data by a select country = db.cell(cond.buildSelect("select ADDRESS.COUNTRY from ADDRESS " - + "join RELATION on RELATION.ADDRESS_ID = ADDRESS.ADDRESSID ")); + + "join RELATION on RELATION.ADDRESS_ID = ADDRESS.ADDRESSID ", "1 = 1")); if (country != "") result.string(country); \ No newline at end of file diff --git a/entity/History_entity/conditionProcess.js b/entity/History_entity/conditionProcess.js index f4f1d1b7f2d..f98df46a082 100644 --- a/entity/History_entity/conditionProcess.js +++ b/entity/History_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("HISTORYLINK.ROW_ID", "$param.RowId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/Offer_entity/conditionProcess.js b/entity/Offer_entity/conditionProcess.js index f3c5610c26a..7cab1216028 100644 --- a/entity/Offer_entity/conditionProcess.js +++ b/entity/Offer_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("OFFER.SALESPROJECT_ID", "$param.SalesprojectId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/Pers_entity/conditionProcess.js b/entity/Pers_entity/conditionProcess.js index f1ac79e47dd..78fee76c103 100644 --- a/entity/Pers_entity/conditionProcess.js +++ b/entity/Pers_entity/conditionProcess.js @@ -7,4 +7,4 @@ cond.andPrepareVars("RELATION.ORG_ID", "$param.OrgId_param"); //TODO; add OBJECT_ID (probably another param) //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js b/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js index 802c305df65..047799d07d9 100644 --- a/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js +++ b/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js @@ -9,6 +9,6 @@ orgId = vars.get("$field.ORGID"); if (orgId){ cond = new SqlCondition(); cond.and("RELATION.PERS_ID is null").andPrepare("RELATION.ORG_ID", orgId) - orgRelId = db.cell(cond.buildSelect("select RELATION.RELATIONID from RELATION")); + orgRelId = db.cell(cond.buildSelect("select RELATION.RELATIONID from RELATION", "1 = 1")); result.string(orgRelId); } \ No newline at end of file diff --git a/entity/SalesprojectCompetition_entity/conditionProcess.js b/entity/SalesprojectCompetition_entity/conditionProcess.js index 1964cca4537..7211c893151 100644 --- a/entity/SalesprojectCompetition_entity/conditionProcess.js +++ b/entity/SalesprojectCompetition_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("SALESPROJECT_COMPETITION.SALESPROJECT_ID", "$param.SalesprojectId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/SalesprojectCycle_entity/conditionProcess.js b/entity/SalesprojectCycle_entity/conditionProcess.js index ad9aa8dfa41..46b431f0896 100644 --- a/entity/SalesprojectCycle_entity/conditionProcess.js +++ b/entity/SalesprojectCycle_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("SALESPROJECT_CYCLE.SALESPROJECT_ID", "$param.SalesprojectId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/SalesprojectForecast_entity/conditionProcess.js b/entity/SalesprojectForecast_entity/conditionProcess.js index 314018b82d9..ab985582570 100644 --- a/entity/SalesprojectForecast_entity/conditionProcess.js +++ b/entity/SalesprojectForecast_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("SALESPROJECT_FORECAST.SALESPROJECT_ID", "$param.SalesprojectId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/SalesprojectMember_entity/conditionProcess.js b/entity/SalesprojectMember_entity/conditionProcess.js index e4a53bd3919..d7a57bbf3f4 100644 --- a/entity/SalesprojectMember_entity/conditionProcess.js +++ b/entity/SalesprojectMember_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("SALESPROJECT_MEMBER.SALESPROJECT_ID", "$param.SalesprojectId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/SalesprojectSource_entity/conditionProcess.js b/entity/SalesprojectSource_entity/conditionProcess.js index 2766d09d00e..e319b875ebe 100644 --- a/entity/SalesprojectSource_entity/conditionProcess.js +++ b/entity/SalesprojectSource_entity/conditionProcess.js @@ -6,4 +6,4 @@ var cond = new SqlCondition(); cond.andPrepareVars("SALESPROJECT_SOURCE.SALESPROJECT_ID", "$param.SalesprojectId_param"); //TODO: use a preparedCondition when available -result.string(db.translateCondition(cond.build())); \ No newline at end of file +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/projectcode/onValidation.js b/entity/Salesproject_entity/entityfields/projectcode/onValidation.js index b880f9dc7f6..811153527dd 100644 --- a/entity/Salesproject_entity/entityfields/projectcode/onValidation.js +++ b/entity/Salesproject_entity/entityfields/projectcode/onValidation.js @@ -9,5 +9,5 @@ var SalesprojectUtils = new SalesprojectUtils(); if( vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !SalesprojectUtils.validateProjectNumber(ProcessHandlingUtil.getOnValidationValue(vars.get("$field.PROJECTCODE"))) ) { - vars.set( "$field.PROJECTCODE", SalesprojectUtils.getNextProjectNumber().toString() ); + vars.set( "$field.PROJECTCODE", SalesprojectUtils.getNextProjectNumber().toString("1 = 1") ); } \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index bb8def27417..c76111f80df 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -989,6 +989,7 @@ </entry> <entry> <key>Deliver opinion</key> + <value>Stellungnahme abgeben</value> </entry> <entry> <key>Presentation follow-up</key> diff --git a/others/db_changes/masterChangelog.xml b/others/db_changes/masterChangelog.xml index 4ce4d0a862c..f838fc14cc3 100644 --- a/others/db_changes/masterChangelog.xml +++ b/others/db_changes/masterChangelog.xml @@ -14,6 +14,12 @@ <include file="struct/create_productprice.xml"/> <include file="struct/create_stock.xml"/> <include file="struct/create_salesproject.xml"/> + <include file="struct/create_salesproject_classification.xml"/> + <include file="struct/create_salesproject_competition.xml"/> + <include file="struct/create_salesproject_cycle.xml"/> + <include file="struct/create_salesproject_forecast.xml"/> + <include file="struct/create_salesproject_member.xml"/> + <include file="struct/create_salesproject_source.xml"/> <include file="struct/create_offer.xml"/> <include file="struct/create_offeritem.xml"/> <include file="struct/contractChanges.xml"/> diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index dba1eccba0d..5652eed7555 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -38,9 +38,8 @@ SqlCondition.prototype.and = function(cond){ * same as the "and"-function but with preparedStatement functionality * @param {String} field the database field as "tablename.columnname"; e.g. "ORG.NAME" * @param {String} value the value that shall be set into the prepared statement - * @param {String} cond opt the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; + * @param {String} [cond="# = ?"] the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; * e.g. "# > ?"; escaping the number sign is possible with a backslash "\" - * Default is "# = ?" * @param {Numeric} [fieldType] SQL-column-type; if the fieldType is not given it's loaded automatically; * please note that this can be a performace issue if it happens a lot of times (e.g. in aloop) * @return {Object} current SqlCondition-object @@ -69,9 +68,8 @@ SqlCondition.prototype.or = function(cond){ * same as the "or"-function but with preparedStatement functionality * @param {String} field the database field as "tablename.columnname"; e.g. "ORG.NAME" * @param {String} value the value that shall be set into the prepared statement - * @param {String} cond the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; + * @param {String} [cond="# = ?"] the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; * e.g. "# > ?"; escaping the number sign is possible with a backslash "\" - * Default is "# = ?" * @param {Numeric} [fieldType] SQL-column-type; if the fieldType is not given it's loaded automatically; * please note that this can be a performace issue if it happens a lot of times (e.g. in aloop) * @return {Object} current SqlCondition-object @@ -85,9 +83,8 @@ SqlCondition.prototype.orPrepare = function(field, value, cond, fieldType){ * same as the "andPrepare"-function but with validation of adito-variables functionality * @param {String} field the database field as "tablename.columnname"; e.g. "ORG.NAME" * @param {String} variable the adito-variable that shall be set into the prepared statement - * @param {String} cond opt the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; + * @param {String} [cond = "# = ?" ] the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; * e.g. "# > ?"; escaping the number sign is possible with a backslash "\" - * Default is "# = ?" * @param {Numeric} [fieldType] SQL-column-type; if the fieldType is not given it's loaded automatically; * please note that this can be a performace issue if it happens a lot of times (e.g. in aloop) * @return {Object} current SqlCondition-object @@ -104,9 +101,8 @@ SqlCondition.prototype.andPrepareVars = function(field, variable, cond, fieldTyp * same as the "orPrepare"-function but with validation of adito-variables functionality * @param {String} field the database field as "tablename.columnname"; e.g. "ORG.NAME" * @param {String} variable the adito-variable that shall be set into the prepared statement - * @param {String} cond opt the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; + * @param {String} [cond="# = ?"] the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; * e.g. "# > ?"; escaping the number sign is possible with a backslash "\" - * Default is "# = ?" * @param {Numeric} [fieldType] SQL-column-type; if the fieldType is not given it's loaded automatically; * please note that this can be a performace issue if it happens a lot of times (e.g. in aloop) * @return {Object} current SqlCondition-object @@ -121,12 +117,10 @@ SqlCondition.prototype.orPrepareVars = function(field, variable, cond, fieldType /** * ready to use string; does not contain a where keyword at the beginning - * @param {String} alternativeCond opt condition that is returned when nothing has been appended. Default is "1 = 1". + * @param {String} [alternativeCond=""] condition that is returned when nothing has been appended. * @return {String} concatenated SQL-condition; empty string if nothing has been appended or - if passed - the alternativeCond */ SqlCondition.prototype.toString = function(alternativeCond){ - if (alternativeCond == undefined) { alternativeCond = "1 = 1" } - if (!this._sqlStorage && alternativeCond) return alternativeCond else @@ -135,7 +129,7 @@ SqlCondition.prototype.toString = function(alternativeCond){ /** * ready to use string; does contain a where keyword at the beginning - * @param {String} alternativeCond opt condition that is returned when nothing has been appended. Default is "1 = 1". + * @param {String} [alternativeCond=""] condition that is returned when nothing has been appended. * @return {String} concatenated SQL-condition; empty string if nothing has been appended or - if passed - the alternativeCond */ SqlCondition.prototype.toWhereString = function(alternativeCond){ @@ -148,7 +142,7 @@ SqlCondition.prototype.toWhereString = function(alternativeCond){ /** * ready to use prepared condition; does not contain a where keyword at the beginning - * @param {String} alternativeCond opt Condition that is returned when nothing has been appended. Default is "1 = 1". + * @param {String} [alternativeCond=""] Condition that is returned when nothing has been appended. * @return {Array[][][]} Prepared condition with [condition, [[field1, type1], [field2, type2]]] */ SqlCondition.prototype.build = function(alternativeCond){ @@ -158,11 +152,11 @@ SqlCondition.prototype.build = function(alternativeCond){ /** * ready to use prepared select * @param {String} beforeCondition Part of the sql before the condition without where (e.g. "select FIRSTNAME from PERS") - * @param {String} alternativeCond opt Condition that is returned when nothing has been appended. Default is "1 = 1". - * @param {String} afterCondition opt Part of the sql after the condition (e.g. "order by FIRSTNAME"). Default is "". + * @param {String} [alternativeCond=""] Condition that is returned when nothing has been appended. + * @param {String} [afterCondition=""] Part of the sql after the condition (e.g. "order by FIRSTNAME"). * @return {Array[][][]} Prepared condition with [condition, [[field1, type1], [field2, type2]]] */ -SqlCondition.prototype.buildSelect = function(beforeCondition, alternativeCond, afterCondition){ +SqlCondition.prototype.buildSelect = function(beforeCondition, alternativeCond, afterCondition) { if (afterCondition == undefined) { afterCondition = "" }; return [beforeCondition + " " + cond.toWhereString(alternativeCond) + " " + afterCondition, cond.preparedValues]; } -- GitLab