From 70a529076d0adc7af555c5e383d3f66a9cd7a57f Mon Sep 17 00:00:00 2001 From: Tijs Rademakers Date: Wed, 12 Jun 2024 12:13:42 +0200 Subject: [PATCH] Add support for SQL Server NVarchar (#3909) * Work in progress: to support differentiating between varchar/nvarchar (which is needed to improve sql server performance), all mappings need to get the correct type. For other databases, regular varchar is fine, hence why the typehandler is always the same for those databases * Nvarchar mappings for TimerJob * event subscription and cmmn engine updates * Nvarchar mappings for Execution * Nvarchar mappings for Batch * Nvarchar mappings for ExternalWorkerJob * Nvarchar mappings for ByteArray * cmmn engine updates * Nvarchar mappings for Job * cmmn engine updates * Nvarchar mappings for Property and Comment * cmmn engine updates * Nvarchar mappings for HistoricDetail and HistoricTaskInstance * cmmn engine updates * cmmn engine updates * cmmn engine updates * Nvarchar mappings for HistoricProcessInstance and Resource * Nvarchar mappings for Model and ProcessDefinitionInfo * Simplify nvarchar test * Nvarchar mappings for Model and HistoricEntityLink * cmmn engine updates * Nvarchar mappings for VariableInstance * cmmn engine updates * Nvarchar mappings for HistoricActivityInstance * Nvarchar mappings for DMN * App engine nvarchar changes * Comment out varchar to nvarchar changes * IDM nvarchar changes * event registry updates * fixes --------- Co-authored-by: Joram Barrez --- .../app/db/mapping/entity/AppDefinition.xml | 84 +- .../app/db/mapping/entity/AppDeployment.xml | 26 +- .../app/db/mapping/entity/AppResource.xml | 10 +- .../batch/service/db/mapping/entity/Batch.xml | 84 +- .../service/db/mapping/entity/BatchPart.xml | 132 +- .../data/impl/MybatisResourceDataManager.java | 2 +- .../liquibase/flowable-cmmn-db-changelog.xml | 11 + .../cmmn/db/mapping/entity/CaseDefinition.xml | 106 +- .../cmmn/db/mapping/entity/CaseInstance.xml | 304 +-- .../cmmn/db/mapping/entity/CmmnDeployment.xml | 64 +- .../cmmn/db/mapping/entity/CmmnResource.xml | 34 +- .../mapping/entity/HistoricCaseInstance.xml | 307 ++- .../entity/HistoricMilestoneInstance.xml | 66 +- .../entity/HistoricPlanItemInstance.xml | 264 +-- .../db/mapping/entity/MilestoneInstance.xml | 62 +- .../db/mapping/entity/PlanItemInstance.xml | 256 +- .../db/mapping/entity/SentryPartInstance.xml | 46 +- .../dmn/db/mapping/entity/Decision.xml | 86 +- .../dmn/db/mapping/entity/DmnDeployment.xml | 24 +- .../dmn/db/mapping/entity/DmnResource.xml | 20 +- .../entity/HistoricDecisionExecution.xml | 42 +- .../impl/AbstractEngineConfiguration.java | 18 +- .../common/db/mapping/entity/ByteArray.xml | 40 +- .../common/db/mapping/entity/Property.xml | 28 +- .../db/mapping/entity/ActivityInstance.xml | 170 +- .../flowable/db/mapping/entity/Attachment.xml | 100 +- .../flowable/db/mapping/entity/Comment.xml | 114 +- .../flowable/db/mapping/entity/Deployment.xml | 112 +- .../db/mapping/entity/EventLogEntry.xml | 102 +- .../flowable/db/mapping/entity/Execution.xml | 630 ++--- .../entity/HistoricActivityInstance.xml | 184 +- .../db/mapping/entity/HistoricDetail.xml | 176 +- .../entity/HistoricProcessInstance.xml | 456 ++-- .../org/flowable/db/mapping/entity/Model.xml | 118 +- .../db/mapping/entity/ProcessDefinition.xml | 222 +- .../mapping/entity/ProcessDefinitionInfo.xml | 34 +- .../flowable/db/mapping/entity/Resource.xml | 36 +- .../service/db/mapping/entity/EntityLink.xml | 150 +- .../db/mapping/entity/HistoricEntityLink.xml | 170 +- .../db/mapping/entity/ChannelDefinition.xml | 96 +- .../db/mapping/entity/EventDefinition.xml | 88 +- .../db/mapping/entity/EventDeployment.xml | 28 +- .../db/mapping/entity/EventResource.xml | 32 +- .../db/mapping/entity/EventSubscription.xml | 690 +++--- .../mapping/entity/HistoricIdentityLink.xml | 120 +- .../db/mapping/entity/IdentityLink.xml | 180 +- .../flowable/idm/db/mapping/entity/Group.xml | 62 +- .../idm/db/mapping/entity/IdentityInfo.xml | 80 +- .../idm/db/mapping/entity/IdmByteArray.xml | 26 +- .../idm/db/mapping/entity/IdmProperty.xml | 24 +- .../idm/db/mapping/entity/Membership.xml | 20 +- .../idm/db/mapping/entity/Privilege.xml | 32 +- .../db/mapping/entity/PrivilegeMapping.xml | 48 +- .../flowable/idm/db/mapping/entity/Token.xml | 92 +- .../flowable/idm/db/mapping/entity/User.xml | 118 +- .../db/mapping/entity/DeadLetterJob.xml | 260 +- .../db/mapping/entity/ExternalWorkerJob.xml | 328 +-- .../service/db/mapping/entity/HistoryJob.xml | 136 +- .../job/service/db/mapping/entity/Job.xml | 272 +-- .../db/mapping/entity/SuspendedJob.xml | 264 +-- .../service/db/mapping/entity/TimerJob.xml | 304 +-- .../db/EngineMappingsValidationTest.java | 150 +- .../db/EntityParameterTypesOverview.java | 2109 +++++++++++++++++ .../mapping/entity/HistoricTaskInstance.xml | 824 +++---- .../mapping/entity/HistoricTaskLogEntry.xml | 168 +- .../task/service/db/mapping/entity/Task.xml | 766 +++--- .../entity/HistoricVariableInstance.xml | 218 +- .../db/mapping/entity/VariableInstance.xml | 210 +- 68 files changed, 7458 insertions(+), 5177 deletions(-) create mode 100644 modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/test/java/org/flowable/db/EntityParameterTypesOverview.java diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/mapping/entity/AppDefinition.xml b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/mapping/entity/AppDefinition.xml index d28fa3557bd..594dc7025dc 100644 --- a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/mapping/entity/AppDefinition.xml +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/mapping/entity/AppDefinition.xml @@ -62,18 +62,18 @@ - delete from ${prefix}ACT_APP_APPDEF where ID_ = #{id} + delete from ${prefix}ACT_APP_APPDEF where ID_ = #{id, jdbcType=VARCHAR} - delete from ${prefix}ACT_APP_APPDEF where DEPLOYMENT_ID_ = #{deploymenId} + delete from ${prefix}ACT_APP_APPDEF where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} - - - + + + @@ -89,51 +89,51 @@ - select * from ${prefix}ACT_APP_DEPLOYMENT D where NAME_=#{parameter} order by D.DEPLOY_TIME_ desc + select * from ${prefix}ACT_APP_DEPLOYMENT D where NAME_=#{parameter, jdbcType=VARCHAR} order by D.DEPLOY_TIME_ desc - select NAME_ from ${prefix}ACT_APP_DEPLOYMENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter} order by NAME_ asc + select NAME_ from ${prefix}ACT_APP_DEPLOYMENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter, jdbcType=VARCHAR} order by NAME_ asc diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/mapping/entity/Batch.xml b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/mapping/entity/Batch.xml index c16209fd0b1..9e83fd5ebf4 100644 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/mapping/entity/Batch.xml +++ b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/mapping/entity/Batch.xml @@ -5,47 +5,47 @@ - + - - - + + + - + - + INSERT INTO ${prefix}FLW_RU_BATCH(ID_, REV_, TYPE_, SEARCH_KEY_, SEARCH_KEY2_, CREATE_TIME_, COMPLETE_TIME_, STATUS_, BATCH_DOC_ID_, TENANT_ID_) - VALUES (#{id, jdbcType=VARCHAR}, + VALUES (#{id, jdbcType=NVARCHAR}, #{revision, jdbcType=INTEGER}, - #{batchType, jdbcType=VARCHAR}, - #{batchSearchKey, jdbcType=VARCHAR}, - #{batchSearchKey2, jdbcType=VARCHAR}, + #{batchType, jdbcType=NVARCHAR}, + #{batchSearchKey, jdbcType=NVARCHAR}, + #{batchSearchKey2, jdbcType=NVARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{completeTime, jdbcType=TIMESTAMP}, - #{status, jdbcType=VARCHAR}, + #{status, jdbcType=NVARCHAR}, #{batchDocRefId, typeHandler=BatchByteArrayRefTypeHandler}, - #{tenantId, jdbcType=VARCHAR}) + #{tenantId, jdbcType=NVARCHAR}) INSERT INTO ${prefix}FLW_RU_BATCH(ID_, REV_, TYPE_, SEARCH_KEY_, SEARCH_KEY2_, CREATE_TIME_, COMPLETE_TIME_, STATUS_, BATCH_DOC_ID_, TENANT_ID_) VALUES - (#{batch.id, jdbcType=VARCHAR}, + (#{batch.id, jdbcType=NVARCHAR}, #{batch.revision, jdbcType=INTEGER}, - #{batch.batchType, jdbcType=VARCHAR}, - #{batch.batchSearchKey, jdbcType=VARCHAR}, - #{batch.batchSearchKey2, jdbcType=VARCHAR}, + #{batch.batchType, jdbcType=NVARCHAR}, + #{batch.batchSearchKey, jdbcType=NVARCHAR}, + #{batch.batchSearchKey2, jdbcType=NVARCHAR}, #{batch.createTime, jdbcType=TIMESTAMP}, #{batch.completeTime, jdbcType=TIMESTAMP}, - #{batch.status, jdbcType=VARCHAR}, + #{batch.status, jdbcType=NVARCHAR}, #{batch.batchDocRefId, typeHandler=BatchByteArrayRefTypeHandler}, - #{batch.tenantId, jdbcType=VARCHAR}) + #{batch.tenantId, jdbcType=NVARCHAR}) @@ -53,16 +53,16 @@ INSERT ALL INTO ${prefix}FLW_RU_BATCH(ID_, REV_, TYPE_, SEARCH_KEY_, SEARCH_KEY2_, CREATE_TIME_, COMPLETE_TIME_, STATUS_, BATCH_DOC_ID_, TENANT_ID_) VALUES - (#{batch.id, jdbcType=VARCHAR}, + (#{batch.id, jdbcType=NVARCHAR}, #{batch.revision, jdbcType=INTEGER}, - #{batch.batchType, jdbcType=VARCHAR}, - #{batch.batchSearchKey, jdbcType=VARCHAR}, - #{batch.batchSearchKey2, jdbcType=VARCHAR}, + #{batch.batchType, jdbcType=NVARCHAR}, + #{batch.batchSearchKey, jdbcType=NVARCHAR}, + #{batch.batchSearchKey2, jdbcType=NVARCHAR}, #{batch.createTime, jdbcType=TIMESTAMP}, #{batch.completeTime, jdbcType=TIMESTAMP}, - #{batch.status, jdbcType=VARCHAR}, + #{batch.status, jdbcType=NVARCHAR}, #{batch.batchDocRefId, typeHandler=BatchByteArrayRefTypeHandler}, - #{batch.tenantId, jdbcType=VARCHAR}) + #{batch.tenantId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -73,16 +73,16 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, - STATUS_ = #{status, jdbcType=VARCHAR}, + STATUS_ = #{status, jdbcType=NVARCHAR}, COMPLETE_TIME_ = #{completeTime, jdbcType=TIMESTAMP}, - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}, + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR}, - where ID_ = #{id, jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} @@ -90,7 +90,7 @@ delete from ${prefix}FLW_RU_BATCH - where ID_ = #{id, jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} @@ -133,13 +133,13 @@ - where RES.ID_ = #{id, jdbcType=VARCHAR} + where RES.ID_ = #{id, jdbcType=NVARCHAR} - select * from ${prefix}ACT_CMMN_CASEDEF where ID_ = #{caseDefinitionId, jdbcType=VARCHAR} + select * from ${prefix}ACT_CMMN_CASEDEF where ID_ = #{id, jdbcType=VARCHAR} - select * from ${prefix}ACT_CMMN_RU_CASE_INST where CASE_DEF_ID_ = #{parameter} + select * from ${prefix}ACT_CMMN_RU_CASE_INST where CASE_DEF_ID_ = #{parameter, jdbcType=VARCHAR} diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CmmnDeployment.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CmmnDeployment.xml index c10144b9b1a..0653777aec5 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CmmnDeployment.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CmmnDeployment.xml @@ -22,31 +22,31 @@ insert into ${prefix}ACT_CMMN_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, PARENT_DEPLOYMENT_ID_) values - + ( - #{deployment.id, jdbcType=VARCHAR}, - #{deployment.name, jdbcType=VARCHAR}, - #{deployment.category, jdbcType=VARCHAR}, - #{deployment.key, jdbcType=VARCHAR}, - #{deployment.tenantId, jdbcType=VARCHAR}, - #{deployment.deploymentTime, jdbcType=TIMESTAMP}, - #{deployment.parentDeploymentId, jdbcType=VARCHAR} + #{cmmnDeployment.id, jdbcType=VARCHAR}, + #{cmmnDeployment.name, jdbcType=VARCHAR}, + #{cmmnDeployment.category, jdbcType=VARCHAR}, + #{cmmnDeployment.key, jdbcType=VARCHAR}, + #{cmmnDeployment.tenantId, jdbcType=VARCHAR}, + #{cmmnDeployment.deploymentTime, jdbcType=TIMESTAMP}, + #{cmmnDeployment.parentDeploymentId, jdbcType=VARCHAR} ) INSERT ALL - + into ${prefix}ACT_CMMN_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, PARENT_DEPLOYMENT_ID_) values ( - #{deployment.id, jdbcType=VARCHAR}, - #{deployment.name, jdbcType=VARCHAR}, - #{deployment.category, jdbcType=VARCHAR}, - #{deployment.key, jdbcType=VARCHAR}, - #{deployment.tenantId, jdbcType=VARCHAR}, - #{deployment.deploymentTime, jdbcType=TIMESTAMP}, - #{deployment.parentDeploymentId, jdbcType=VARCHAR} + #{cmmnDeployment.id, jdbcType=VARCHAR}, + #{cmmnDeployment.name, jdbcType=VARCHAR}, + #{cmmnDeployment.category, jdbcType=VARCHAR}, + #{cmmnDeployment.key, jdbcType=VARCHAR}, + #{cmmnDeployment.tenantId, jdbcType=VARCHAR}, + #{cmmnDeployment.deploymentTime, jdbcType=TIMESTAMP}, + #{cmmnDeployment.parentDeploymentId, jdbcType=VARCHAR} ) SELECT * FROM dual @@ -76,7 +76,7 @@ - delete from ${prefix}ACT_CMMN_DEPLOYMENT where ID_ = #{id} + delete from ${prefix}ACT_CMMN_DEPLOYMENT where ID_ = #{id, jdbcType=VARCHAR} @@ -94,7 +94,7 @@ - select NAME_ from ${prefix}ACT_CMMN_DEPLOYMENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter} order by NAME_ asc + select NAME_ from ${prefix}ACT_CMMN_DEPLOYMENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter, jdbcType=VARCHAR} order by NAME_ asc diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml index d6c02f0cf0d..1bee6a23ab3 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml @@ -7,23 +7,23 @@ insert into ${prefix}ACT_CMMN_HI_CASE_INST (ID_, REV_, NAME_, PARENT_ID_, CASE_DEF_ID_, BUSINESS_KEY_, STATE_, START_TIME_, END_TIME_, START_USER_ID_, LAST_REACTIVATION_TIME_, LAST_REACTIVATION_USER_ID_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, TENANT_ID_, BUSINESS_STATUS_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{name ,jdbcType=VARCHAR}, - #{parentId ,jdbcType=VARCHAR}, - #{caseDefinitionId ,jdbcType=VARCHAR}, - #{businessKey ,jdbcType=VARCHAR}, - #{state ,jdbcType=VARCHAR}, - #{startTime ,jdbcType=TIMESTAMP}, - #{endTime ,jdbcType=TIMESTAMP}, - #{startUserId ,jdbcType=VARCHAR}, - #{lastReactivationTime ,jdbcType=TIMESTAMP}, - #{lastReactivationUserId ,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, + 1, #{name, jdbcType=VARCHAR}, + #{parentId, jdbcType=VARCHAR}, + #{caseDefinitionId, jdbcType=VARCHAR}, + #{businessKey, jdbcType=VARCHAR}, + #{state, jdbcType=VARCHAR}, + #{startTime, jdbcType=TIMESTAMP}, + #{endTime, jdbcType=TIMESTAMP}, + #{startUserId, jdbcType=VARCHAR}, + #{lastReactivationTime, jdbcType=TIMESTAMP}, + #{lastReactivationUserId, jdbcType=VARCHAR}, #{callbackId, jdbcType=VARCHAR}, #{callbackType, jdbcType=VARCHAR}, #{referenceId, jdbcType=VARCHAR}, #{referenceType, jdbcType=VARCHAR}, - #{tenantId ,jdbcType=VARCHAR}, - #{businessStatus ,jdbcType=VARCHAR} + #{tenantId, jdbcType=VARCHAR}, + #{businessStatus, jdbcType=VARCHAR} ) @@ -32,23 +32,23 @@ values ( - #{historicCaseInstance.id ,jdbcType=VARCHAR}, - 1, #{historicCaseInstance.name ,jdbcType=VARCHAR}, - #{historicCaseInstance.parentId ,jdbcType=VARCHAR}, - #{historicCaseInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{historicCaseInstance.businessKey ,jdbcType=VARCHAR}, - #{historicCaseInstance.state,jdbcType=VARCHAR}, - #{historicCaseInstance.startTime ,jdbcType=TIMESTAMP}, - #{historicCaseInstance.endTime ,jdbcType=TIMESTAMP}, - #{historicCaseInstance.startUserId ,jdbcType=VARCHAR}, - #{historicCaseInstance.lastReactivationTime ,jdbcType=TIMESTAMP}, - #{historicCaseInstance.lastReactivationUserId ,jdbcType=VARCHAR}, + #{historicCaseInstance.id, jdbcType=VARCHAR}, + 1, #{historicCaseInstance.name, jdbcType=VARCHAR}, + #{historicCaseInstance.parentId, jdbcType=VARCHAR}, + #{historicCaseInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{historicCaseInstance.businessKey, jdbcType=VARCHAR}, + #{historicCaseInstance.state, jdbcType=VARCHAR}, + #{historicCaseInstance.startTime, jdbcType=TIMESTAMP}, + #{historicCaseInstance.endTime, jdbcType=TIMESTAMP}, + #{historicCaseInstance.startUserId, jdbcType=VARCHAR}, + #{historicCaseInstance.lastReactivationTime, jdbcType=TIMESTAMP}, + #{historicCaseInstance.lastReactivationUserId, jdbcType=VARCHAR}, #{historicCaseInstance.callbackId, jdbcType=VARCHAR}, #{historicCaseInstance.callbackType, jdbcType=VARCHAR}, #{historicCaseInstance.referenceId, jdbcType=VARCHAR}, #{historicCaseInstance.referenceType, jdbcType=VARCHAR}, - #{historicCaseInstance.tenantId ,jdbcType=VARCHAR}, - #{historicCaseInstance.businessStatus ,jdbcType=VARCHAR} + #{historicCaseInstance.tenantId, jdbcType=VARCHAR}, + #{historicCaseInstance.businessStatus, jdbcType=VARCHAR} ) @@ -58,23 +58,23 @@ into ${prefix}ACT_CMMN_HI_CASE_INST (ID_, REV_, NAME_, PARENT_ID_, CASE_DEF_ID_, BUSINESS_KEY_, STATE_, START_TIME_, END_TIME_, START_USER_ID_, LAST_REACTIVATION_TIME_, LAST_REACTIVATION_USER_ID_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, TENANT_ID_, BUSINESS_STATUS_) VALUES ( - #{historicCaseInstance.id ,jdbcType=VARCHAR}, - 1, #{historicCaseInstance.name ,jdbcType=VARCHAR}, - #{historicCaseInstance.parentId ,jdbcType=VARCHAR}, - #{historicCaseInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{historicCaseInstance.businessKey ,jdbcType=VARCHAR}, - #{historicCaseInstance.state ,jdbcType=VARCHAR}, - #{historicCaseInstance.startTime ,jdbcType=TIMESTAMP}, - #{historicCaseInstance.endTime ,jdbcType=TIMESTAMP}, - #{historicCaseInstance.startUserId ,jdbcType=VARCHAR}, - #{historicCaseInstance.lastReactivationTime ,jdbcType=TIMESTAMP}, - #{historicCaseInstance.lastReactivationUserId ,jdbcType=VARCHAR}, + #{historicCaseInstance.id, jdbcType=VARCHAR}, + 1, #{historicCaseInstance.name, jdbcType=VARCHAR}, + #{historicCaseInstance.parentId, jdbcType=VARCHAR}, + #{historicCaseInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{historicCaseInstance.businessKey, jdbcType=VARCHAR}, + #{historicCaseInstance.state, jdbcType=VARCHAR}, + #{historicCaseInstance.startTime, jdbcType=TIMESTAMP}, + #{historicCaseInstance.endTime, jdbcType=TIMESTAMP}, + #{historicCaseInstance.startUserId, jdbcType=VARCHAR}, + #{historicCaseInstance.lastReactivationTime, jdbcType=TIMESTAMP}, + #{historicCaseInstance.lastReactivationUserId, jdbcType=VARCHAR}, #{historicCaseInstance.callbackId, jdbcType=VARCHAR}, #{historicCaseInstance.callbackType, jdbcType=VARCHAR}, #{historicCaseInstance.referenceId, jdbcType=VARCHAR}, #{historicCaseInstance.referenceType, jdbcType=VARCHAR}, - #{historicCaseInstance.tenantId ,jdbcType=VARCHAR}, - #{historicCaseInstance.businessStatus ,jdbcType=VARCHAR} + #{historicCaseInstance.tenantId, jdbcType=VARCHAR}, + #{historicCaseInstance.businessStatus, jdbcType=VARCHAR} ) SELECT * FROM dual @@ -137,11 +137,11 @@ - delete from ${prefix}ACT_CMMN_HI_CASE_INST where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_CMMN_HI_CASE_INST where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_CMMN_HI_CASE_INST where CASE_DEF_ID_ = #{value} + delete from ${prefix}ACT_CMMN_HI_CASE_INST where CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} @@ -151,8 +151,8 @@ or ID_ in - - #{item} + + #{id, jdbcType=VARCHAR} @@ -188,22 +188,21 @@ extends="historicCaseInstanceResultMap"> - - - + + + - - - - - - - + + + + + + + - - + + @@ -226,8 +225,8 @@ or PARENT_ID_ in - - #{item} + + #{parentId, jdbcType=VARCHAR} @@ -334,37 +333,37 @@ - and CASE_DEF.KEY_ = #{caseDefinitionKey} + and CASE_DEF.KEY_ = #{caseDefinitionKey, jdbcType=VARCHAR} and CASE_DEF.KEY_ IN - #{caseDefinitionKey} + #{caseDefinitionKey, jdbcType=VARCHAR} - and CASE_DEF.CATEGORY_ = #{caseDefinitionCategory} + and CASE_DEF.CATEGORY_ = #{caseDefinitionCategory, jdbcType=VARCHAR} - and CASE_DEF.NAME_ = #{caseDefinitionName} + and CASE_DEF.NAME_ = #{caseDefinitionName, jdbcType=VARCHAR} - and CASE_DEF.DEPLOYMENT_ID_ = #{deploymentId} + and CASE_DEF.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} and CASE_DEF.DEPLOYMENT_ID_ IN - #{deploymentId} + #{deploymentId, jdbcType=VARCHAR} - and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.ID_ = SCOPE_ID_ and SUB_SCOPE_ID_ is null and SCOPE_TYPE_ = 'cmmn') + and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.ID_ = SCOPE_ID_ and SUB_SCOPE_ID_ is null and SCOPE_TYPE_ = 'cmmn') - and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.ID_ = SCOPE_ID_ and SUB_SCOPE_ID_ is null and SCOPE_TYPE_ = 'cmmn') + and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.ID_ = SCOPE_ID_ and SUB_SCOPE_ID_ is null and SCOPE_TYPE_ = 'cmmn') and exists ( @@ -377,10 +376,10 @@ - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.VAR_TYPE_ = #{queryVariableValue.type} + and V.VAR_TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -395,7 +394,7 @@ LIKE - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -410,7 +409,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -418,7 +417,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -427,7 +426,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null @@ -458,31 +457,31 @@ - or CASE_DEF.KEY_ = #{orQueryObject.caseDefinitionKey} + or CASE_DEF.KEY_ = #{orQueryObject.caseDefinitionKey, jdbcType=VARCHAR} or CASE_DEF.KEY_ IN - #{caseDefinitionKey} + #{caseDefinitionKey, jdbcType=VARCHAR} - or CASE_DEF.CATEGORY_ = #{orQueryObject.caseDefinitionCategory} + or CASE_DEF.CATEGORY_ = #{orQueryObject.caseDefinitionCategory, jdbcType=VARCHAR} - or CASE_DEF.NAME_ = #{orQueryObject.caseDefinitionName} + or CASE_DEF.NAME_ = #{orQueryObject.caseDefinitionName, jdbcType=VARCHAR} - or CASE_DEF.VERSION_ = #{orQueryObject.caseDefinitionVersion} + or CASE_DEF.VERSION_ = #{orQueryObject.caseDefinitionVersion, jdbcType=INTEGER} - or CASE_DEF.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId} + or CASE_DEF.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId, jdbcType=VARCHAR} or CASE_DEF.DEPLOYMENT_ID_ IN - #{deploymentId} + #{deploymentId, jdbcType=VARCHAR} @@ -490,11 +489,11 @@ - and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.ID_ = SCOPE_ID_ and + and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.ID_ = SCOPE_ID_ and SUB_SCOPE_ID_ is null and SCOPE_TYPE_ = 'cmmn') - and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.ID_ = SCOPE_ID_ and + and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.ID_ = SCOPE_ID_ and SUB_SCOPE_ID_ is null and SCOPE_TYPE_ = 'cmmn') @@ -507,10 +506,10 @@ and V.SCOPE_TYPE_ = 'cmmn' - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.VAR_TYPE_ = #{queryVariableValue.type} + and V.VAR_TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -527,7 +526,7 @@ - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -542,7 +541,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -550,7 +549,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -559,7 +558,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null @@ -590,42 +589,42 @@ - ${queryTablePrefix}ID_ = #{caseInstanceId} + ${queryTablePrefix}ID_ = #{caseInstanceId, jdbcType=VARCHAR} and ${queryTablePrefix}ID_ IN - #{caseInstanceId} + #{caseInstanceId, jdbcType=VARCHAR} - and ${queryTablePrefix}CASE_DEF_ID_ = #{caseDefinitionId} + and ${queryTablePrefix}CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} and ${queryTablePrefix}CASE_DEF_ID_ IN - #{caseDefinitionId} + #{caseDefinitionId, jdbcType=VARCHAR} - and ${queryTablePrefix}PARENT_ID_ = #{caseInstanceParentId} + and ${queryTablePrefix}PARENT_ID_ = #{caseInstanceParentId, jdbcType=VARCHAR} and ${queryTablePrefix}PARENT_ID_ is null - and ${queryTablePrefix}NAME_ = #{caseInstanceName} + and ${queryTablePrefix}NAME_ = #{caseInstanceName, jdbcType=VARCHAR} - and ${queryTablePrefix}NAME_ like #{caseInstanceNameLike}${wildcardEscapeClause} + and ${queryTablePrefix}NAME_ like #{caseInstanceNameLike, jdbcType=VARCHAR}${wildcardEscapeClause} - and lower(${queryTablePrefix}NAME_) LIKE lower(#{caseInstanceNameLikeIgnoreCase})${wildcardEscapeClause} + and lower(${queryTablePrefix}NAME_) LIKE lower(#{caseInstanceNameLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} and EXISTS(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where - LINK.SCOPE_ID_ = #{parentScopeId} + LINK.SCOPE_ID_ = #{parentScopeId, jdbcType=NVARCHAR} and LINK.REF_SCOPE_ID_ = RES.ID_ and LINK.HIERARCHY_TYPE_ = 'parent' ) @@ -633,14 +632,14 @@ and exists(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where LINK.REF_SCOPE_ID_ = RES.ID_ - and LINK.ROOT_SCOPE_ID_ = #{rootScopeId} + and LINK.ROOT_SCOPE_ID_ = #{rootScopeId, jdbcType=NVARCHAR} ) - and ${queryTablePrefix}BUSINESS_KEY_ = #{businessKey} + and ${queryTablePrefix}BUSINESS_KEY_ = #{businessKey, jdbcType=VARCHAR} - and ${queryTablePrefix}BUSINESS_STATUS_ = #{businessStatus} + and ${queryTablePrefix}BUSINESS_STATUS_ = #{businessStatus, jdbcType=VARCHAR} and ${queryTablePrefix}END_TIME_ is not null @@ -649,69 +648,69 @@ and ${queryTablePrefix}END_TIME_ is null - and ${queryTablePrefix}START_TIME_ <= #{startedBefore} + and ${queryTablePrefix}START_TIME_ <= #{startedBefore, jdbcType=TIMESTAMP} - and ${queryTablePrefix}START_TIME_ >= #{startedAfter} + and ${queryTablePrefix}START_TIME_ >= #{startedAfter, jdbcType=TIMESTAMP} - and ${queryTablePrefix}END_TIME_ <= #{finishedBefore} + and ${queryTablePrefix}END_TIME_ <= #{finishedBefore, jdbcType=TIMESTAMP} - and ${queryTablePrefix}END_TIME_ >= #{finishedAfter} + and ${queryTablePrefix}END_TIME_ >= #{finishedAfter, jdbcType=TIMESTAMP} - and ${queryTablePrefix}START_USER_ID_ = #{startedBy} + and ${queryTablePrefix}START_USER_ID_ = #{startedBy, jdbcType=VARCHAR} - and ${queryTablePrefix}STATE_ = #{state} + and ${queryTablePrefix}STATE_ = #{state, jdbcType=VARCHAR} - and ${queryTablePrefix}LAST_REACTIVATION_TIME_ <= #{lastReactivatedBefore} + and ${queryTablePrefix}LAST_REACTIVATION_TIME_ <= #{lastReactivatedBefore, jdbcType=TIMESTAMP} - and ${queryTablePrefix}LAST_REACTIVATION_TIME_ >= #{lastReactivatedAfter} + and ${queryTablePrefix}LAST_REACTIVATION_TIME_ >= #{lastReactivatedAfter, jdbcType=TIMESTAMP} - and ${queryTablePrefix}LAST_REACTIVATION_USER_ID_ = #{lastReactivatedBy} + and ${queryTablePrefix}LAST_REACTIVATION_USER_ID_ = #{lastReactivatedBy, jdbcType=VARCHAR} - and ${queryTablePrefix}CALLBACK_ID_ = #{callbackId} + and ${queryTablePrefix}CALLBACK_ID_ = #{callbackId, jdbcType=VARCHAR} - and ${queryTablePrefix}CALLBACK_TYPE_ = #{callbackType} + and ${queryTablePrefix}CALLBACK_TYPE_ = #{callbackType, jdbcType=VARCHAR} and ${queryTablePrefix}CALLBACK_ID_ is null - and ${queryTablePrefix}REFERENCE_ID_ = #{referenceId} + and ${queryTablePrefix}REFERENCE_ID_ = #{referenceId, jdbcType=VARCHAR} - and ${queryTablePrefix}REFERENCE_TYPE_ = #{referenceType} + and ${queryTablePrefix}REFERENCE_TYPE_ = #{referenceType, jdbcType=VARCHAR} - and ${queryTablePrefix}TENANT_ID_ = #{tenantId} + and ${queryTablePrefix}TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} and (${queryTablePrefix}TENANT_ID_ is null or ${queryTablePrefix}TENANT_ID_ = '') - and EXISTS(select ID_ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST P where P.CASE_INST_ID_ = ${queryTablePrefix}ID_ and P.ITEM_DEFINITION_ID_ = #{activePlanItemDefinitionId} and P.STATE_ = 'active') + and EXISTS(select ID_ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST P where P.CASE_INST_ID_ = ${queryTablePrefix}ID_ and P.ITEM_DEFINITION_ID_ = #{activePlanItemDefinitionId, jdbcType=VARCHAR} and P.STATE_ = 'active') and EXISTS(select ID_ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST P where P.CASE_INST_ID_ = ${queryTablePrefix}ID_ and P.ITEM_DEFINITION_ID_ in - #{activePlanItemDefinitionId} + #{activePlanItemDefinitionId, jdbcType=VARCHAR} and P.STATE_ = 'active') - and EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and I.USER_ID_ = #{involvedUser}) + and EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and I.USER_ID_ = #{involvedUser, jdbcType=NVARCHAR}) and EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and - I.USER_ID_ = #{involvedUserIdentityLink.userId} and I.TYPE_ = #{involvedUserIdentityLink.type}) + I.USER_ID_ = #{involvedUserIdentityLink.userId, jdbcType=NVARCHAR} and I.TYPE_ = #{involvedUserIdentityLink.type, jdbcType=NVARCHAR}) and EXISTS( @@ -722,9 +721,9 @@ or I.GROUP_ID_ IN - - #{group} + #{involvedGroup, jdbcType=NVARCHAR} ) @@ -732,50 +731,50 @@ and EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and - I.GROUP_ID_ = #{involvedGroupIdentityLink.groupId} and I.TYPE_ = #{involvedGroupIdentityLink.type}) + I.GROUP_ID_ = #{involvedGroupIdentityLink.groupId, jdbcType=NVARCHAR} and I.TYPE_ = #{involvedGroupIdentityLink.type, jdbcType=NVARCHAR}) - ${queryTablePrefix}ID_ = #{orQueryObject.caseInstanceId} + ${queryTablePrefix}ID_ = #{orQueryObject.caseInstanceId, jdbcType=VARCHAR} or ${queryTablePrefix}ID_ IN - #{caseInstanceId} + #{caseInstanceId, jdbcType=VARCHAR} - or ${queryTablePrefix}CASE_DEF_ID_ = #{orQueryObject.caseDefinitionId} + or ${queryTablePrefix}CASE_DEF_ID_ = #{orQueryObject.caseDefinitionId, jdbcType=VARCHAR} or ${queryTablePrefix}CASE_DEF_ID_ IN - #{caseDefinitionId} + #{caseDefinitionId, jdbcType=VARCHAR} - or ${queryTablePrefix}PARENT_ID_ = #{orQueryObject.caseInstanceParentId} + or ${queryTablePrefix}PARENT_ID_ = #{orQueryObject.caseInstanceParentId, jdbcType=VARCHAR} or ${queryTablePrefix}PARENT_ID_ is null - or ${queryTablePrefix}NAME_ = #{orQueryObject.caseInstanceName} + or ${queryTablePrefix}NAME_ = #{orQueryObject.caseInstanceName, jdbcType=VARCHAR} - or ${queryTablePrefix}NAME_ like #{orQueryObject.caseInstanceNameLike}${wildcardEscapeClause} + or ${queryTablePrefix}NAME_ like #{orQueryObject.caseInstanceNameLike, jdbcType=VARCHAR}${wildcardEscapeClause} - or lower(${queryTablePrefix}NAME_) LIKE lower(#{orQueryObject.caseInstanceNameLikeIgnoreCase})${wildcardEscapeClause} + or lower(${queryTablePrefix}NAME_) LIKE lower(#{orQueryObject.caseInstanceNameLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} - or ${queryTablePrefix}BUSINESS_KEY_ = #{orQueryObject.businessKey} + or ${queryTablePrefix}BUSINESS_KEY_ = #{orQueryObject.businessKey, jdbcType=VARCHAR} - or ${queryTablePrefix}BUSINESS_STATUS_ = #{orQueryObject.businessStatus} + or ${queryTablePrefix}BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=VARCHAR} or ${queryTablePrefix}END_TIME_ is not null @@ -784,70 +783,70 @@ or ${queryTablePrefix}END_TIME_ is null - or ${queryTablePrefix}START_TIME_ <= #{orQueryObject.startedBefore} + or ${queryTablePrefix}START_TIME_ <= #{orQueryObject.startedBefore, jdbcType=TIMESTAMP} - or ${queryTablePrefix}START_TIME_ >= #{orQueryObject.startedAfter} + or ${queryTablePrefix}START_TIME_ >= #{orQueryObject.startedAfter, jdbcType=TIMESTAMP} - or ${queryTablePrefix}END_TIME_ <= #{orQueryObject.finishedBefore} + or ${queryTablePrefix}END_TIME_ <= #{orQueryObject.finishedBefore, jdbcType=TIMESTAMP} - or ${queryTablePrefix}END_TIME_ >= #{orQueryObject.finishedAfter} + or ${queryTablePrefix}END_TIME_ >= #{orQueryObject.finishedAfter, jdbcType=TIMESTAMP} - or ${queryTablePrefix}START_USER_ID_ = #{orQueryObject.startedBy} + or ${queryTablePrefix}START_USER_ID_ = #{orQueryObject.startedBy, jdbcType=VARCHAR} - or ${queryTablePrefix}STATE_ = #{orQueryObject.state} + or ${queryTablePrefix}STATE_ = #{orQueryObject.state, jdbcType=VARCHAR} - or ${queryTablePrefix}LAST_REACTIVATION_TIME_ <= #{lastReactivatedBefore} + or ${queryTablePrefix}LAST_REACTIVATION_TIME_ <= #{lastReactivatedBefore, jdbcType=TIMESTAMP} - or ${queryTablePrefix}LAST_REACTIVATION_TIME_ >= #{lastReactivatedAfter} + or ${queryTablePrefix}LAST_REACTIVATION_TIME_ >= #{lastReactivatedAfter, jdbcType=TIMESTAMP} - or ${queryTablePrefix}LAST_REACTIVATION_USER_ID_ = #{lastReactivatedBy} + or ${queryTablePrefix}LAST_REACTIVATION_USER_ID_ = #{lastReactivatedBy, jdbcType=VARCHAR} - or ${queryTablePrefix}CALLBACK_ID_ = #{orQueryObject.callbackId} + or ${queryTablePrefix}CALLBACK_ID_ = #{orQueryObject.callbackId, jdbcType=VARCHAR} - or ${queryTablePrefix}CALLBACK_TYPE_ = #{orQueryObject.callbackType} + or ${queryTablePrefix}CALLBACK_TYPE_ = #{orQueryObject.callbackType, jdbcType=VARCHAR} or ${queryTablePrefix}CALLBACK_ID_ is null - or ${queryTablePrefix}REFERENCE_ID_ = #{orQueryObject.referenceId} + or ${queryTablePrefix}REFERENCE_ID_ = #{orQueryObject.referenceId, jdbcType=VARCHAR} - or ${queryTablePrefix}REFERENCE_TYPE_ = #{orQueryObject.referenceType} + or ${queryTablePrefix}REFERENCE_TYPE_ = #{orQueryObject.referenceType, jdbcType=VARCHAR} - or ${queryTablePrefix}TENANT_ID_ = #{orQueryObject.tenantId} + or ${queryTablePrefix}TENANT_ID_ = #{orQueryObject.tenantId, jdbcType=VARCHAR} or (${queryTablePrefix}TENANT_ID_ is null or ${queryTablePrefix}TENANT_ID_ = '') - or EXISTS(select ID_ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST P where P.CASE_INST_ID_ = ${queryTablePrefix}ID_ and P.ITEM_DEFINITION_ID_ = #{activePlanItemDefinitionId} and P.STATE_ = 'active') + or EXISTS(select ID_ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST P where P.CASE_INST_ID_ = ${queryTablePrefix}ID_ and P.ITEM_DEFINITION_ID_ = #{activePlanItemDefinitionId, jdbcType=VARCHAR} and P.STATE_ = 'active') or EXISTS(select ID_ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST P where P.CASE_INST_ID_ = ${queryTablePrefix}ID_ and P.ITEM_DEFINITION_ID_ in - #{activePlanItemDefinitionId} + #{activePlanItemDefinitionId, jdbcType=VARCHAR} and P.STATE_ = 'active') or EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and I.USER_ID_ = - #{orQueryObject.involvedUser}) + #{orQueryObject.involvedUser, jdbcType=NVARCHAR}) or EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and - I.USER_ID_ = #{orQueryObject.involvedUserIdentityLink.userId} and I.TYPE_ = #{orQueryObject.involvedUserIdentityLink.type}) + I.USER_ID_ = #{orQueryObject.involvedUserIdentityLink.userId, jdbcType=NVARCHAR} and I.TYPE_ = #{orQueryObject.involvedUserIdentityLink.type, jdbcType=NVARCHAR}) or EXISTS( @@ -858,9 +857,9 @@ or I.GROUP_ID_ IN - - #{group} + #{involvedGroup, jdbcType=NVARCHAR} ) @@ -868,11 +867,11 @@ or EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.SCOPE_ID_ = ${queryTablePrefix}ID_ and I.SCOPE_TYPE_ = 'cmmn' and - I.GROUP_ID_ = #{orQueryObject.involvedGroupIdentityLink.groupId} and I.TYPE_ = #{orQueryObject.involvedGroupIdentityLink.type}) + I.GROUP_ID_ = #{orQueryObject.involvedGroupIdentityLink.groupId, jdbcType=NVARCHAR} and I.TYPE_ = #{orQueryObject.involvedGroupIdentityLink.type, jdbcType=NVARCHAR}) or EXISTS(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where - LINK.SCOPE_ID_ = #{orQueryObject.parentScopeId} + LINK.SCOPE_ID_ = #{orQueryObject.parentScopeId, jdbcType=NVARCHAR} and LINK.REF_SCOPE_ID_ = RES.ID_ and LINK.HIERARCHY_TYPE_ = 'parent' ) @@ -880,13 +879,13 @@ or exists(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where LINK.REF_SCOPE_ID_ = RES.ID_ - and LINK.ROOT_SCOPE_ID_ = #{orQueryObject.rootScopeId} + and LINK.ROOT_SCOPE_ID_ = #{orQueryObject.rootScopeId, jdbcType=NVARCHAR} ) diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricMilestoneInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricMilestoneInstance.xml index 6699076651c..e020ae3fe67 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricMilestoneInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricMilestoneInstance.xml @@ -7,11 +7,11 @@ insert into ${prefix}ACT_CMMN_HI_MIL_INST (ID_, REV_, NAME_, TIME_STAMP_, CASE_INST_ID_, CASE_DEF_ID_, ELEMENT_ID_, TENANT_ID_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{name ,jdbcType=VARCHAR}, - #{timeStamp ,jdbcType=TIMESTAMP}, - #{caseInstanceId ,jdbcType=VARCHAR}, - #{caseDefinitionId ,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, + 1, #{name, jdbcType=VARCHAR}, + #{timeStamp, jdbcType=TIMESTAMP}, + #{caseInstanceId, jdbcType=VARCHAR}, + #{caseDefinitionId, jdbcType=VARCHAR}, #{elementId, jdbcType=VARCHAR}, #{tenantId, jdbcType=VARCHAR} ) @@ -21,31 +21,31 @@ insert into ${prefix}ACT_CMMN_HI_MIL_INST (ID_, REV_, NAME_, TIME_STAMP_, CASE_INST_ID_, CASE_DEF_ID_, ELEMENT_ID_, TENANT_ID_) values - + ( - #{milestone.id ,jdbcType=VARCHAR}, - 1, #{milestone.name ,jdbcType=VARCHAR}, - #{milestone.timeStamp ,jdbcType=TIMESTAMP}, - #{milestone.caseInstanceId ,jdbcType=VARCHAR}, - #{milestone.caseDefinitionId ,jdbcType=VARCHAR}, - #{milestone.elementId, jdbcType=VARCHAR}, - #{milestone.tenantId, jdbcType=VARCHAR} + #{historicMilestoneInstance.id, jdbcType=VARCHAR}, + 1, #{historicMilestoneInstance.name, jdbcType=VARCHAR}, + #{historicMilestoneInstance.timeStamp, jdbcType=TIMESTAMP}, + #{historicMilestoneInstance.caseInstanceId, jdbcType=VARCHAR}, + #{historicMilestoneInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{historicMilestoneInstance.elementId, jdbcType=VARCHAR}, + #{historicMilestoneInstance.tenantId, jdbcType=VARCHAR} ) INSERT ALL - + into ${prefix}ACT_CMMN_HI_MIL_INST (ID_, REV_, NAME_, TIME_STAMP_, CASE_INST_ID_, CASE_DEF_ID_, ELEMENT_ID_, TENANT_ID_) VALUES ( - #{milestone.id ,jdbcType=VARCHAR}, - 1, #{milestone.name ,jdbcType=VARCHAR}, - #{milestone.timeStamp ,jdbcType=TIMESTAMP}, - #{milestone.caseInstanceId ,jdbcType=VARCHAR}, - #{milestone.caseDefinitionId ,jdbcType=VARCHAR}, - #{milestone.elementId, jdbcType=VARCHAR}, - #{milestone.tenantId, jdbcType=VARCHAR} + #{historicMilestoneInstance.id, jdbcType=VARCHAR}, + 1, #{historicMilestoneInstance.name, jdbcType=VARCHAR}, + #{historicMilestoneInstance.timeStamp, jdbcType=TIMESTAMP}, + #{historicMilestoneInstance.caseInstanceId, jdbcType=VARCHAR}, + #{historicMilestoneInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{historicMilestoneInstance.elementId, jdbcType=VARCHAR}, + #{historicMilestoneInstance.tenantId, jdbcType=VARCHAR} ) SELECT * FROM dual @@ -69,11 +69,11 @@ - delete from ${prefix}ACT_CMMN_HI_MIL_INST where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_CMMN_HI_MIL_INST where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_CMMN_HI_MIL_INST where CASE_DEF_ID_ = #{value} + delete from ${prefix}ACT_CMMN_HI_MIL_INST where CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} @@ -83,8 +83,8 @@ or CASE_INST_ID_ in - - #{item} + + #{caseInstanceId, jdbcType=VARCHAR} @@ -136,28 +136,28 @@ from ${prefix}ACT_CMMN_HI_MIL_INST RES - RES.ID_ = #{id} + RES.ID_ = #{id, jdbcType=VARCHAR} - RES.NAME_ = #{name} + RES.NAME_ = #{name, jdbcType=VARCHAR} - and RES.CASE_INST_ID_ = #{caseInstanceId} + and RES.CASE_INST_ID_ = #{caseInstanceId, jdbcType=VARCHAR} - and RES.CASE_DEF_ID_ = #{caseDefinitionId} + and RES.CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} - and RES.TIME_STAMP_ <= #{reachedBefore} + and RES.TIME_STAMP_ <= #{reachedBefore, jdbcType=TIMESTAMP} - and RES.TIME_STAMP_ >= #{reachedAfter} + and RES.TIME_STAMP_ >= #{reachedAfter, jdbcType=TIMESTAMP} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=VARCHAR} and (RES.TENANT_ID_ is null or RES.TENANT_ID_ = '') diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricPlanItemInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricPlanItemInstance.xml index d15913fc3b8..1ae1a3b21c9 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricPlanItemInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricPlanItemInstance.xml @@ -10,38 +10,38 @@ LAST_STARTED_TIME_, LAST_SUSPENDED_TIME_, COMPLETED_TIME_, OCCURRED_TIME_, TERMINATED_TIME_, EXIT_TIME_, ENDED_TIME_, LAST_UPDATED_TIME_, START_USER_ID_, REFERENCE_ID_, REFERENCE_TYPE_, ENTRY_CRITERION_ID_, EXIT_CRITERION_ID_, SHOW_IN_OVERVIEW_, EXTRA_VALUE_, TENANT_ID_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{name ,jdbcType=VARCHAR}, - #{state ,jdbcType=VARCHAR}, - #{caseDefinitionId ,jdbcType=VARCHAR}, - #{derivedCaseDefinitionId ,jdbcType=VARCHAR}, - #{caseInstanceId ,jdbcType=VARCHAR}, - #{stageInstanceId ,jdbcType=VARCHAR}, - #{isStage ,jdbcType=BOOLEAN}, - #{elementId ,jdbcType=VARCHAR}, - #{planItemDefinitionId ,jdbcType=VARCHAR}, - #{planItemDefinitionType ,jdbcType=VARCHAR}, - #{createTime ,jdbcType=TIMESTAMP}, - #{lastAvailableTime ,jdbcType=TIMESTAMP}, - #{lastUnavailableTime ,jdbcType=TIMESTAMP}, - #{lastEnabledTime ,jdbcType=TIMESTAMP}, - #{lastDisabledTime ,jdbcType=TIMESTAMP}, - #{lastStartedTime ,jdbcType=TIMESTAMP}, - #{lastSuspendedTime ,jdbcType=TIMESTAMP}, - #{completedTime ,jdbcType=TIMESTAMP}, - #{occurredTime ,jdbcType=TIMESTAMP}, - #{terminatedTime ,jdbcType=TIMESTAMP}, - #{exitTime ,jdbcType=TIMESTAMP}, - #{endedTime ,jdbcType=TIMESTAMP}, + #{id, jdbcType=VARCHAR}, + 1, #{name, jdbcType=VARCHAR}, + #{state, jdbcType=VARCHAR}, + #{caseDefinitionId, jdbcType=VARCHAR}, + #{derivedCaseDefinitionId, jdbcType=VARCHAR}, + #{caseInstanceId, jdbcType=VARCHAR}, + #{stageInstanceId, jdbcType=VARCHAR}, + #{isStage, jdbcType=BOOLEAN}, + #{elementId, jdbcType=VARCHAR}, + #{planItemDefinitionId, jdbcType=VARCHAR}, + #{planItemDefinitionType, jdbcType=VARCHAR}, + #{createTime, jdbcType=TIMESTAMP}, + #{lastAvailableTime, jdbcType=TIMESTAMP}, + #{lastUnavailableTime, jdbcType=TIMESTAMP}, + #{lastEnabledTime, jdbcType=TIMESTAMP}, + #{lastDisabledTime, jdbcType=TIMESTAMP}, + #{lastStartedTime, jdbcType=TIMESTAMP}, + #{lastSuspendedTime, jdbcType=TIMESTAMP}, + #{completedTime, jdbcType=TIMESTAMP}, + #{occurredTime, jdbcType=TIMESTAMP}, + #{terminatedTime, jdbcType=TIMESTAMP}, + #{exitTime, jdbcType=TIMESTAMP}, + #{endedTime, jdbcType=TIMESTAMP}, #{lastUpdatedTime, jdbcType=TIMESTAMP}, - #{startUserId ,jdbcType=VARCHAR}, - #{referenceId ,jdbcType=VARCHAR}, - #{referenceType ,jdbcType=VARCHAR}, + #{startUserId, jdbcType=VARCHAR}, + #{referenceId, jdbcType=VARCHAR}, + #{referenceType, jdbcType=VARCHAR}, #{entryCriterionId, jdbcType=VARCHAR}, #{exitCriterionId, jdbcType=VARCHAR}, #{showInOverview, jdbcType=BOOLEAN}, #{extraValue, jdbcType=VARCHAR}, - #{tenantId ,jdbcType=VARCHAR} + #{tenantId, jdbcType=VARCHAR} ) @@ -53,38 +53,38 @@ values ( - #{historicPlanItemInstance.id ,jdbcType=VARCHAR}, - 1, #{historicPlanItemInstance.name ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.state ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.derivedCaseDefinitionId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.caseInstanceId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.stageInstanceId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.isStage ,jdbcType=BOOLEAN}, - #{historicPlanItemInstance.elementId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.planItemDefinitionId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.planItemDefinitionType ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.createTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastAvailableTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastUnavailableTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastEnabledTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastDisabledTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastStartedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastSuspendedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.completedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.occurredTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.terminatedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.exitTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.endedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastUpdatedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.startUserId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.referenceId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.referenceType ,jdbcType=VARCHAR}, + #{historicPlanItemInstance.id, jdbcType=VARCHAR}, + 1, #{historicPlanItemInstance.name, jdbcType=VARCHAR}, + #{historicPlanItemInstance.state, jdbcType=VARCHAR}, + #{historicPlanItemInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.derivedCaseDefinitionId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.caseInstanceId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.stageInstanceId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.isStage, jdbcType=BOOLEAN}, + #{historicPlanItemInstance.elementId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.planItemDefinitionId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.planItemDefinitionType, jdbcType=VARCHAR}, + #{historicPlanItemInstance.createTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastAvailableTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastUnavailableTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastEnabledTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastDisabledTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastStartedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastSuspendedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.completedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.occurredTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.terminatedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.exitTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.endedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastUpdatedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.startUserId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.referenceId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.referenceType, jdbcType=VARCHAR}, #{historicPlanItemInstance.entryCriterionId, jdbcType=VARCHAR}, #{historicPlanItemInstance.exitCriterionId, jdbcType=VARCHAR}, #{historicPlanItemInstance.showInOverview, jdbcType=BOOLEAN}, #{historicPlanItemInstance.extraValue, jdbcType=VARCHAR}, - #{historicPlanItemInstance.tenantId ,jdbcType=VARCHAR} + #{historicPlanItemInstance.tenantId, jdbcType=VARCHAR} ) @@ -97,38 +97,38 @@ LAST_STARTED_TIME_, LAST_SUSPENDED_TIME_, COMPLETED_TIME_, OCCURRED_TIME_, TERMINATED_TIME_, EXIT_TIME_, ENDED_TIME_, LAST_UPDATED_TIME_, START_USER_ID_, REFERENCE_ID_, REFERENCE_TYPE_, ENTRY_CRITERION_ID_, EXIT_CRITERION_ID_, SHOW_IN_OVERVIEW_, EXTRA_VALUE_, TENANT_ID_) VALUES ( - #{historicPlanItemInstance.id ,jdbcType=VARCHAR}, - 1, #{historicPlanItemInstance.name ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.state ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.derivedCaseDefinitionId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.caseInstanceId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.stageInstanceId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.isStage ,jdbcType=BOOLEAN}, - #{historicPlanItemInstance.elementId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.planItemDefinitionId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.planItemDefinitionType ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.createTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastAvailableTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastUnavailableTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastEnabledTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastDisabledTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastStartedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastSuspendedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.completedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.occurredTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.terminatedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.exitTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.endedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.lastUpdatedTime ,jdbcType=TIMESTAMP}, - #{historicPlanItemInstance.startUserId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.referenceId ,jdbcType=VARCHAR}, - #{historicPlanItemInstance.referenceType ,jdbcType=VARCHAR}, + #{historicPlanItemInstance.id, jdbcType=VARCHAR}, + 1, #{historicPlanItemInstance.name, jdbcType=VARCHAR}, + #{historicPlanItemInstance.state, jdbcType=VARCHAR}, + #{historicPlanItemInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.derivedCaseDefinitionId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.caseInstanceId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.stageInstanceId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.isStage, jdbcType=BOOLEAN}, + #{historicPlanItemInstance.elementId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.planItemDefinitionId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.planItemDefinitionType, jdbcType=VARCHAR}, + #{historicPlanItemInstance.createTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastAvailableTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastUnavailableTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastEnabledTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastDisabledTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastStartedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastSuspendedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.completedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.occurredTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.terminatedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.exitTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.endedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.lastUpdatedTime, jdbcType=TIMESTAMP}, + #{historicPlanItemInstance.startUserId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.referenceId, jdbcType=VARCHAR}, + #{historicPlanItemInstance.referenceType, jdbcType=VARCHAR}, #{historicPlanItemInstance.entryCriterionId, jdbcType=VARCHAR}, #{historicPlanItemInstance.exitCriterionId, jdbcType=VARCHAR}, #{historicPlanItemInstance.showInOverview, jdbcType=BOOLEAN}, #{historicPlanItemInstance.extraValue, jdbcType=VARCHAR}, - #{historicPlanItemInstance.tenantId ,jdbcType=VARCHAR} + #{historicPlanItemInstance.tenantId, jdbcType=VARCHAR} ) SELECT * FROM dual @@ -224,7 +224,7 @@ EXIT_CRITERION_ID_ = #{exitCriterionId, jdbcType=VARCHAR}, - SHOW_IN_OVERVIEW_ = #{showInOverview, jdbcType=VARCHAR}, + SHOW_IN_OVERVIEW_ = #{showInOverview, jdbcType=BOOLEAN}, EXTRA_VALUE_ = #{extraValue, jdbcType=VARCHAR}, @@ -238,11 +238,11 @@ - delete from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST where CASE_DEF_ID_ = #{value} + delete from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST where CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} @@ -252,8 +252,8 @@ or CASE_INST_ID_ in - - #{item} + + #{caseInstanceId, jdbcType=VARCHAR} @@ -327,116 +327,116 @@ from ${prefix}ACT_CMMN_HI_PLAN_ITEM_INST RES - RES.ID_ = #{planItemInstanceId} + RES.ID_ = #{planItemInstanceId, jdbcType=VARCHAR} - RES.NAME_ = #{planItemInstanceName} + RES.NAME_ = #{planItemInstanceName, jdbcType=VARCHAR} - and RES.STATE_ = #{state} + and RES.STATE_ = #{state, jdbcType=VARCHAR} - and RES.CASE_DEF_ID_ = #{caseDefinitionId} + and RES.CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} - and RES.DERIVED_CASE_DEF_ID_ = #{derivedCaseDefinitionId} + and RES.DERIVED_CASE_DEF_ID_ = #{derivedCaseDefinitionId, jdbcType=VARCHAR} - and RES.CASE_INST_ID_ = #{caseInstanceId} + and RES.CASE_INST_ID_ = #{caseInstanceId, jdbcType=VARCHAR} - and RES.STAGE_INST_ID_ = #{stageInstanceId} + and RES.STAGE_INST_ID_ = #{stageInstanceId, jdbcType=VARCHAR} - and RES.ELEMENT_ID_ = #{elementId} + and RES.ELEMENT_ID_ = #{elementId, jdbcType=VARCHAR} - and RES.ITEM_DEFINITION_ID_ = #{planItemDefinitionId} + and RES.ITEM_DEFINITION_ID_ = #{planItemDefinitionId, jdbcType=VARCHAR} - and RES.ITEM_DEFINITION_TYPE_ = #{planItemDefinitionType} + and RES.ITEM_DEFINITION_TYPE_ = #{planItemDefinitionType, jdbcType=VARCHAR} - and RES.ITEM_DEFINITION_TYPE_ in #{type} + and RES.ITEM_DEFINITION_TYPE_ in #{planItemDefinitionType, jdbcType=VARCHAR} - and RES.CREATE_TIME_ <= #{createdBefore} + and RES.CREATE_TIME_ <= #{createdBefore, jdbcType=TIMESTAMP} - and RES.CREATE_TIME_ >= #{createdAfter} + and RES.CREATE_TIME_ >= #{createdAfter, jdbcType=TIMESTAMP} - and RES.LAST_AVAILABLE_TIME_ <= #{lastAvailableBefore} + and RES.LAST_AVAILABLE_TIME_ <= #{lastAvailableBefore, jdbcType=TIMESTAMP} - and RES.LAST_AVAILABLE_TIME_ >= #{lastAvailableAfter} + and RES.LAST_AVAILABLE_TIME_ >= #{lastAvailableAfter, jdbcType=TIMESTAMP} - and RES.LAST_UNAVAILABLE_TIME_ <= #{lastUnavailableBefore} + and RES.LAST_UNAVAILABLE_TIME_ <= #{lastUnavailableBefore, jdbcType=TIMESTAMP} - and RES.LAST_UNAVAILABLE_TIME_ >= #{lastUnavailableAfter} + and RES.LAST_UNAVAILABLE_TIME_ >= #{lastUnavailableAfter, jdbcType=TIMESTAMP} - and RES.LAST_ENABLED_TIME_ <= #{lastEnabledBefore} + and RES.LAST_ENABLED_TIME_ <= #{lastEnabledBefore, jdbcType=TIMESTAMP} - and RES.LAST_ENABLED_TIME_ >= #{lastEnabledAfter} + and RES.LAST_ENABLED_TIME_ >= #{lastEnabledAfter, jdbcType=TIMESTAMP} - and RES.LAST_DISABLED_TIME_ <= #{lastDisabledBefore} + and RES.LAST_DISABLED_TIME_ <= #{lastDisabledBefore, jdbcType=TIMESTAMP} - and RES.LAST_DISABLED_TIME_ >= #{lastDisabledAfter} + and RES.LAST_DISABLED_TIME_ >= #{lastDisabledAfter, jdbcType=TIMESTAMP} - and RES.LAST_STARTED_TIME_ <= #{lastStartedBefore} + and RES.LAST_STARTED_TIME_ <= #{lastStartedBefore, jdbcType=TIMESTAMP} - and RES.LAST_STARTED_TIME_ >= #{lastStartedAfter} + and RES.LAST_STARTED_TIME_ >= #{lastStartedAfter, jdbcType=TIMESTAMP} - and RES.LAST_SUSPENDED_TIME_ <= #{lastSuspendedBefore} + and RES.LAST_SUSPENDED_TIME_ <= #{lastSuspendedBefore, jdbcType=TIMESTAMP} - and RES.LAST_SUSPENDED_TIME_ >= #{lastSuspendedAfter} + and RES.LAST_SUSPENDED_TIME_ >= #{lastSuspendedAfter, jdbcType=TIMESTAMP} - and RES.COMPLETED_TIME_ <= #{completedBefore} + and RES.COMPLETED_TIME_ <= #{completedBefore, jdbcType=TIMESTAMP} - and RES.COMPLETED_TIME_ >= #{completedAfter} + and RES.COMPLETED_TIME_ >= #{completedAfter, jdbcType=TIMESTAMP} - and RES.OCCURRED_TIME_ <= #{occurredBefore} + and RES.OCCURRED_TIME_ <= #{occurredBefore, jdbcType=TIMESTAMP} - and RES.OCCURRED_TIME_ >= #{occurredAfter} + and RES.OCCURRED_TIME_ >= #{occurredAfter, jdbcType=TIMESTAMP} - and RES.TERMINATED_TIME_ <= #{terminatedBefore} + and RES.TERMINATED_TIME_ <= #{terminatedBefore, jdbcType=TIMESTAMP} - and RES.TERMINATED_TIME_ >= #{terminatedAfter} + and RES.TERMINATED_TIME_ >= #{terminatedAfter, jdbcType=TIMESTAMP} - and RES.EXIT_TIME_ <= #{exitBefore} + and RES.EXIT_TIME_ <= #{exitBefore, jdbcType=TIMESTAMP} - and RES.EXIT_TIME_ >= #{exitAfter} + and RES.EXIT_TIME_ >= #{exitAfter, jdbcType=TIMESTAMP} - and RES.ENDED_TIME_ <= #{endedBefore} + and RES.ENDED_TIME_ <= #{endedBefore, jdbcType=TIMESTAMP} - and RES.ENDED_TIME_ >= #{endedAfter} + and RES.ENDED_TIME_ >= #{endedAfter, jdbcType=TIMESTAMP} and RES.ENDED_TIME_ is not null @@ -445,13 +445,13 @@ and RES.ENDED_TIME_ is null - and RES.START_USER_ID_ = #{startUserId} + and RES.START_USER_ID_ = #{startUserId, jdbcType=VARCHAR} - and RES.REFERENCE_ID_ = #{referenceId} + and RES.REFERENCE_ID_ = #{referenceId, jdbcType=VARCHAR} - and RES.REFERENCE_TYPE_ = #{referenceType} + and RES.REFERENCE_TYPE_ = #{referenceType, jdbcType=VARCHAR} and RES.ENTRY_CRITERION_ID_ = #{entryCriterionId, jdbcType=VARCHAR} @@ -473,7 +473,7 @@ and ( - I.USER_ID_ = #{involvedUser} + I.USER_ID_ = #{involvedUser, jdbcType=NVARCHAR} or @@ -485,9 +485,9 @@ or I.GROUP_ID_ IN - - #{group} + #{involvedGroup, jdbcType=NVARCHAR} ) @@ -496,10 +496,10 @@ ) - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=VARCHAR} and (RES.TENANT_ID_ is null or RES.TENANT_ID_ = '') diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/MilestoneInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/MilestoneInstance.xml index b17fb03645d..2177ef6a19e 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/MilestoneInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/MilestoneInstance.xml @@ -7,11 +7,11 @@ insert into ${prefix}ACT_CMMN_RU_MIL_INST (ID_, NAME_, TIME_STAMP_, CASE_INST_ID_, CASE_DEF_ID_, ELEMENT_ID_, TENANT_ID_) values ( - #{id ,jdbcType=VARCHAR}, - #{name ,jdbcType=VARCHAR}, - #{timeStamp ,jdbcType=TIMESTAMP}, - #{caseInstanceId ,jdbcType=VARCHAR}, - #{caseDefinitionId ,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, + #{name, jdbcType=VARCHAR}, + #{timeStamp, jdbcType=TIMESTAMP}, + #{caseInstanceId, jdbcType=VARCHAR}, + #{caseDefinitionId, jdbcType=VARCHAR}, #{elementId, jdbcType=VARCHAR}, #{tenantId, jdbcType=VARCHAR} ) @@ -21,31 +21,31 @@ insert into ${prefix}ACT_CMMN_RU_MIL_INST (ID_, NAME_, TIME_STAMP_, CASE_INST_ID_, CASE_DEF_ID_, ELEMENT_ID_, TENANT_ID_) values - + ( - #{milestone.id ,jdbcType=VARCHAR}, - #{milestone.name ,jdbcType=VARCHAR}, - #{milestone.timeStamp ,jdbcType=TIMESTAMP}, - #{milestone.caseInstanceId ,jdbcType=VARCHAR}, - #{milestone.caseDefinitionId ,jdbcType=VARCHAR}, - #{milestone.elementId, jdbcType=VARCHAR}, - #{milestone.tenantId, jdbcType=VARCHAR} + #{milestoneInstance.id, jdbcType=VARCHAR}, + #{milestoneInstance.name, jdbcType=VARCHAR}, + #{milestoneInstance.timeStamp, jdbcType=TIMESTAMP}, + #{milestoneInstance.caseInstanceId, jdbcType=VARCHAR}, + #{milestoneInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{milestoneInstance.elementId, jdbcType=VARCHAR}, + #{milestoneInstance.tenantId, jdbcType=VARCHAR} ) INSERT ALL - + into ${prefix}ACT_CMMN_RU_MIL_INST (ID_, NAME_, TIME_STAMP_, CASE_INST_ID_, CASE_DEF_ID_, ELEMENT_ID_, TENANT_ID_) VALUES ( - #{milestone.id ,jdbcType=VARCHAR}, - #{milestone.name ,jdbcType=VARCHAR}, - #{milestone.timeStamp ,jdbcType=TIMESTAMP}, - #{milestone.caseInstanceId ,jdbcType=VARCHAR}, - #{milestone.caseDefinitionId ,jdbcType=VARCHAR}, - #{milestone.elementId, jdbcType=VARCHAR}, - #{milestone.tenantId, jdbcType=VARCHAR} + #{milestoneInstance.id, jdbcType=VARCHAR}, + #{milestoneInstance.name, jdbcType=VARCHAR}, + #{milestoneInstance.timeStamp, jdbcType=TIMESTAMP}, + #{milestoneInstance.caseInstanceId, jdbcType=VARCHAR}, + #{milestoneInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{milestoneInstance.elementId, jdbcType=VARCHAR}, + #{milestoneInstance.tenantId, jdbcType=VARCHAR} ) SELECT * FROM dual @@ -68,11 +68,11 @@ - delete from ${prefix}ACT_CMMN_RU_MIL_INST where ID_ = #{id} + delete from ${prefix}ACT_CMMN_RU_MIL_INST where ID_ = #{id, jdbcType=VARCHAR} - delete from ${prefix}ACT_CMMN_RU_MIL_INST where CASE_INST_ID_ = #{value} + delete from ${prefix}ACT_CMMN_RU_MIL_INST where CASE_INST_ID_ = #{caseInstanceId, jdbcType=VARCHAR} @@ -106,28 +106,28 @@ from ${prefix}ACT_CMMN_RU_MIL_INST RES - RES.ID_ = #{milestoneInstanceId} + RES.ID_ = #{milestoneInstanceId, jdbcType=VARCHAR} - RES.NAME_ = #{name} + RES.NAME_ = #{name, jdbcType=VARCHAR} - and RES.CASE_INST_ID_ = #{caseInstanceId} + and RES.CASE_INST_ID_ = #{caseInstanceId, jdbcType=VARCHAR} - and RES.CASE_DEF_ID_ = #{caseDefinitionId} + and RES.CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} - and RES.TIME_STAMP_ <= #{reachedBefore} + and RES.TIME_STAMP_ <= #{reachedBefore, jdbcType=TIMESTAMP} - and RES.TIME_STAMP_ >= #{reachedAfter} + and RES.TIME_STAMP_ >= #{reachedAfter, jdbcType=TIMESTAMP} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=VARCHAR} and (RES.TENANT_ID_ is null or RES.TENANT_ID_ = '') diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/PlanItemInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/PlanItemInstance.xml index 0e933f3c123..0b95bb75bfb 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/PlanItemInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/PlanItemInstance.xml @@ -11,40 +11,40 @@ START_USER_ID_, REFERENCE_ID_, REFERENCE_TYPE_, IS_COMPLETEABLE_, ENTRY_CRITERION_ID_, EXIT_CRITERION_ID_, EXTRA_VALUE_, IS_COUNT_ENABLED_, VAR_COUNT_, SENTRY_PART_INST_COUNT_, TENANT_ID_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{caseDefinitionId ,jdbcType=VARCHAR}, - #{derivedCaseDefinitionId ,jdbcType=VARCHAR}, - #{caseInstanceId ,jdbcType=VARCHAR}, - #{stageInstanceId ,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, + 1, #{caseDefinitionId, jdbcType=VARCHAR}, + #{derivedCaseDefinitionId, jdbcType=VARCHAR}, + #{caseInstanceId, jdbcType=VARCHAR}, + #{stageInstanceId, jdbcType=VARCHAR}, #{isStage, jdbcType=BOOLEAN}, - #{elementId ,jdbcType=VARCHAR}, + #{elementId, jdbcType=VARCHAR}, #{planItemDefinitionId, jdbcType=VARCHAR}, #{planItemDefinitionType, jdbcType=VARCHAR}, - #{name ,jdbcType=VARCHAR}, - #{state ,jdbcType=VARCHAR}, - #{createTime ,jdbcType=TIMESTAMP}, - #{lastAvailableTime ,jdbcType=TIMESTAMP}, - #{lastUnavailableTime ,jdbcType=TIMESTAMP}, - #{lastEnabledTime ,jdbcType=TIMESTAMP}, - #{lastDisabledTime ,jdbcType=TIMESTAMP}, - #{lastStartedTime ,jdbcType=TIMESTAMP}, - #{lastSuspendedTime ,jdbcType=TIMESTAMP}, - #{completedTime ,jdbcType=TIMESTAMP}, - #{occurredTime ,jdbcType=TIMESTAMP}, - #{terminatedTime ,jdbcType=TIMESTAMP}, - #{exitTime ,jdbcType=TIMESTAMP}, - #{endedTime ,jdbcType=TIMESTAMP}, - #{startUserId ,jdbcType=VARCHAR}, - #{referenceId ,jdbcType=VARCHAR}, - #{referenceType ,jdbcType=VARCHAR}, - #{completable ,jdbcType=BOOLEAN}, + #{name, jdbcType=VARCHAR}, + #{state, jdbcType=VARCHAR}, + #{createTime, jdbcType=TIMESTAMP}, + #{lastAvailableTime, jdbcType=TIMESTAMP}, + #{lastUnavailableTime, jdbcType=TIMESTAMP}, + #{lastEnabledTime, jdbcType=TIMESTAMP}, + #{lastDisabledTime, jdbcType=TIMESTAMP}, + #{lastStartedTime, jdbcType=TIMESTAMP}, + #{lastSuspendedTime, jdbcType=TIMESTAMP}, + #{completedTime, jdbcType=TIMESTAMP}, + #{occurredTime, jdbcType=TIMESTAMP}, + #{terminatedTime, jdbcType=TIMESTAMP}, + #{exitTime, jdbcType=TIMESTAMP}, + #{endedTime, jdbcType=TIMESTAMP}, + #{startUserId, jdbcType=VARCHAR}, + #{referenceId, jdbcType=VARCHAR}, + #{referenceType, jdbcType=VARCHAR}, + #{completable, jdbcType=BOOLEAN}, #{entryCriterionId, jdbcType=VARCHAR}, #{exitCriterionId, jdbcType=VARCHAR}, #{extraValue, jdbcType=VARCHAR}, #{countEnabled, jdbcType=BOOLEAN}, #{variableCount, jdbcType=INTEGER}, #{sentryPartInstanceCount, jdbcType=INTEGER}, - #{tenantId ,jdbcType=VARCHAR} + #{tenantId, jdbcType=VARCHAR} ) @@ -57,30 +57,30 @@ values ( - #{planItemInstance.id ,jdbcType=VARCHAR}, - 1, #{planItemInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{planItemInstance.derivedCaseDefinitionId ,jdbcType=VARCHAR}, - #{planItemInstance.caseInstanceId ,jdbcType=VARCHAR}, - #{planItemInstance.stageInstanceId ,jdbcType=VARCHAR}, + #{planItemInstance.id, jdbcType=VARCHAR}, + 1, #{planItemInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{planItemInstance.derivedCaseDefinitionId, jdbcType=VARCHAR}, + #{planItemInstance.caseInstanceId, jdbcType=VARCHAR}, + #{planItemInstance.stageInstanceId, jdbcType=VARCHAR}, #{planItemInstance.isStage, jdbcType=BOOLEAN}, - #{planItemInstance.elementId ,jdbcType=VARCHAR}, + #{planItemInstance.elementId, jdbcType=VARCHAR}, #{planItemInstance.planItemDefinitionId, jdbcType=VARCHAR}, #{planItemInstance.planItemDefinitionType, jdbcType=VARCHAR}, - #{planItemInstance.name ,jdbcType=VARCHAR}, - #{planItemInstance.state ,jdbcType=VARCHAR}, - #{planItemInstance.createTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastAvailableTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastUnavailableTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastEnabledTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastDisabledTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastStartedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastSuspendedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.completedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.occurredTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.terminatedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.exitTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.endedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.startUserId ,jdbcType=VARCHAR}, + #{planItemInstance.name, jdbcType=VARCHAR}, + #{planItemInstance.state, jdbcType=VARCHAR}, + #{planItemInstance.createTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastAvailableTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastUnavailableTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastEnabledTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastDisabledTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastStartedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastSuspendedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.completedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.occurredTime, jdbcType=TIMESTAMP}, + #{planItemInstance.terminatedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.exitTime, jdbcType=TIMESTAMP}, + #{planItemInstance.endedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.startUserId, jdbcType=VARCHAR}, #{planItemInstance.referenceId, jdbcType=VARCHAR}, #{planItemInstance.referenceType, jdbcType=VARCHAR}, #{planItemInstance.completable, jdbcType=BOOLEAN}, @@ -90,7 +90,7 @@ #{planItemInstance.countEnabled, jdbcType=BOOLEAN}, #{planItemInstance.variableCount, jdbcType=INTEGER}, #{planItemInstance.sentryPartInstanceCount, jdbcType=INTEGER}, - #{planItemInstance.tenantId ,jdbcType=VARCHAR} + #{planItemInstance.tenantId, jdbcType=VARCHAR} ) @@ -104,30 +104,30 @@ START_USER_ID_, REFERENCE_ID_, REFERENCE_TYPE_, IS_COMPLETEABLE_, ENTRY_CRITERION_ID_, EXIT_CRITERION_ID_, EXTRA_VALUE_, IS_COUNT_ENABLED_, VAR_COUNT_, SENTRY_PART_INST_COUNT_, TENANT_ID_) VALUES ( - #{planItemInstance.id ,jdbcType=VARCHAR}, - 1, #{planItemInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{planItemInstance.derivedCaseDefinitionId ,jdbcType=VARCHAR}, - #{planItemInstance.caseInstanceId ,jdbcType=VARCHAR}, - #{planItemInstance.stageInstanceId ,jdbcType=VARCHAR}, - #{planItemInstance.isStage ,jdbcType=VARCHAR}, - #{planItemInstance.elementId ,jdbcType=VARCHAR}, + #{planItemInstance.id, jdbcType=VARCHAR}, + 1, #{planItemInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{planItemInstance.derivedCaseDefinitionId, jdbcType=VARCHAR}, + #{planItemInstance.caseInstanceId, jdbcType=VARCHAR}, + #{planItemInstance.stageInstanceId, jdbcType=VARCHAR}, + #{planItemInstance.isStage, jdbcType=BOOLEAN}, + #{planItemInstance.elementId, jdbcType=VARCHAR}, #{planItemInstance.planItemDefinitionId, jdbcType=VARCHAR}, #{planItemInstance.planItemDefinitionType, jdbcType=VARCHAR}, - #{planItemInstance.name ,jdbcType=VARCHAR}, - #{planItemInstance.state ,jdbcType=VARCHAR}, - #{planItemInstance.createTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastAvailableTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastUnavailableTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastEnabledTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastDisabledTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastStartedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.lastSuspendedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.completedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.occurredTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.terminatedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.exitTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.endedTime ,jdbcType=TIMESTAMP}, - #{planItemInstance.startUserId ,jdbcType=VARCHAR}, + #{planItemInstance.name, jdbcType=VARCHAR}, + #{planItemInstance.state, jdbcType=VARCHAR}, + #{planItemInstance.createTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastAvailableTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastUnavailableTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastEnabledTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastDisabledTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastStartedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.lastSuspendedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.completedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.occurredTime, jdbcType=TIMESTAMP}, + #{planItemInstance.terminatedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.exitTime, jdbcType=TIMESTAMP}, + #{planItemInstance.endedTime, jdbcType=TIMESTAMP}, + #{planItemInstance.startUserId, jdbcType=VARCHAR}, #{planItemInstance.referenceId, jdbcType=VARCHAR}, #{planItemInstance.referenceType, jdbcType=VARCHAR}, #{planItemInstance.completable, jdbcType=BOOLEAN}, @@ -137,7 +137,7 @@ #{planItemInstance.countEnabled, jdbcType=BOOLEAN}, #{planItemInstance.variableCount, jdbcType=INTEGER}, #{planItemInstance.sentryPartInstanceCount, jdbcType=INTEGER}, - #{planItemInstance.tenantId ,jdbcType=VARCHAR} + #{planItemInstance.tenantId, jdbcType=VARCHAR} ) SELECT * FROM dual @@ -251,19 +251,19 @@ - delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where CASE_DEF_ID_ = #{value} + delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where CASE_DEF_ID_ = #{caseDefinitionId, jdbcType=VARCHAR} - delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where STAGE_INST_ID_ = #{value} + delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where STAGE_INST_ID_ = #{stageInstanceId, jdbcType=VARCHAR} - delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where CASE_INST_ID_ = #{value} + delete from ${prefix}ACT_CMMN_RU_PLAN_ITEM_INST where CASE_INST_ID_ = #{caseInstanceId, jdbcType=VARCHAR} - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.TYPE_ = #{queryVariableValue.type} + and V.TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -580,7 +580,7 @@ LIKE - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -595,7 +595,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -603,7 +603,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -612,7 +612,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/SentryPartInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/SentryPartInstance.xml index e2bf6b6a395..c3aa18c9d72 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/SentryPartInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/SentryPartInstance.xml @@ -7,13 +7,13 @@ insert into ${prefix}ACT_CMMN_RU_SENTRY_PART_INST (ID_, REV_, CASE_DEF_ID_, CASE_INST_ID_, PLAN_ITEM_INST_ID_, ON_PART_ID_, IF_PART_ID_, TIME_STAMP_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{caseDefinitionId ,jdbcType=VARCHAR}, - #{caseInstanceId ,jdbcType=VARCHAR}, - #{planItemInstanceId ,jdbcType=VARCHAR}, - #{onPartId ,jdbcType=VARCHAR}, - #{ifPartId ,jdbcType=VARCHAR}, - #{timeStamp ,jdbcType=TIMESTAMP} + #{id, jdbcType=VARCHAR}, + 1, #{caseDefinitionId, jdbcType=VARCHAR}, + #{caseInstanceId, jdbcType=VARCHAR}, + #{planItemInstanceId, jdbcType=VARCHAR}, + #{onPartId, jdbcType=VARCHAR}, + #{ifPartId, jdbcType=VARCHAR}, + #{timeStamp, jdbcType=TIMESTAMP} ) @@ -23,13 +23,13 @@ values ( - #{sentryPartInstance.id ,jdbcType=VARCHAR}, - 1, #{sentryPartInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{sentryPartInstance.caseInstanceId ,jdbcType=VARCHAR}, - #{sentryPartInstance.planItemInstanceId ,jdbcType=VARCHAR}, - #{sentryPartInstance.onPartId ,jdbcType=VARCHAR}, - #{sentryPartInstance.ifPartId ,jdbcType=VARCHAR}, - #{sentryPartInstance.timeStamp,jdbcType=TIMESTAMP} + #{sentryPartInstance.id, jdbcType=VARCHAR}, + 1, #{sentryPartInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{sentryPartInstance.caseInstanceId, jdbcType=VARCHAR}, + #{sentryPartInstance.planItemInstanceId, jdbcType=VARCHAR}, + #{sentryPartInstance.onPartId, jdbcType=VARCHAR}, + #{sentryPartInstance.ifPartId, jdbcType=VARCHAR}, + #{sentryPartInstance.timeStamp, jdbcType=TIMESTAMP} ) @@ -39,13 +39,13 @@ into ${prefix}ACT_CMMN_RU_SENTRY_PART_INST (ID_, REV_, CASE_DEF_ID_, CASE_INST_ID_, PLAN_ITEM_INST_ID_, ON_PART_ID_, IF_PART_ID_, TIME_STAMP_) VALUES ( - #{sentryPartInstance.id ,jdbcType=VARCHAR}, - 1, #{sentryPartInstance.caseDefinitionId ,jdbcType=VARCHAR}, - #{sentryPartInstance.caseInstanceId ,jdbcType=VARCHAR}, - #{sentryPartInstance.planItemInstanceId ,jdbcType=VARCHAR}, - #{sentryPartInstance.onPartId ,jdbcType=VARCHAR}, - #{sentryPartInstance.ifPartId ,jdbcType=VARCHAR}, - #{sentryPartInstance.timeStamp ,jdbcType=TIMESTAMP} + #{sentryPartInstance.id, jdbcType=VARCHAR}, + 1, #{sentryPartInstance.caseDefinitionId, jdbcType=VARCHAR}, + #{sentryPartInstance.caseInstanceId, jdbcType=VARCHAR}, + #{sentryPartInstance.planItemInstanceId, jdbcType=VARCHAR}, + #{sentryPartInstance.onPartId, jdbcType=VARCHAR}, + #{sentryPartInstance.ifPartId, jdbcType=VARCHAR}, + #{sentryPartInstance.timeStamp, jdbcType=TIMESTAMP} ) SELECT * FROM dual @@ -78,11 +78,11 @@ - delete from ${prefix}ACT_CMMN_RU_SENTRY_PART_INST where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_CMMN_RU_SENTRY_PART_INST where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_CMMN_RU_SENTRY_PART_INST where CASE_INST_ID_ = #{id} + delete from ${prefix}ACT_CMMN_RU_SENTRY_PART_INST where CASE_INST_ID_ = #{caseInstanceId, jdbcType=VARCHAR} diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/Decision.xml b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/Decision.xml index 75736fddfd8..bcd540d8d07 100644 --- a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/Decision.xml +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/Decision.xml @@ -78,15 +78,15 @@ - delete from ${prefix}ACT_DMN_DECISION where DEPLOYMENT_ID_ = #{deploymenId} + delete from ${prefix}ACT_DMN_DECISION where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} - - + + @@ -103,7 +103,7 @@ select * from ${prefix}ACT_DMN_DECISION - where DEPLOYMENT_ID_ = #{deploymentId} - and KEY_ = #{decisionKey} + where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} + and KEY_ = #{decisionKey, jdbcType=VARCHAR} and (TENANT_ID_ = '' or TENANT_ID_ is null) - select NAME_ from ${prefix}ACT_DMN_DEPLOYMENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter} order by NAME_ asc + select NAME_ from ${prefix}ACT_DMN_DEPLOYMENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter, jdbcType=VARCHAR} order by NAME_ asc \ No newline at end of file diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/HistoricDecisionExecution.xml b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/HistoricDecisionExecution.xml index 92a2926b98d..8793fb3b4c3 100644 --- a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/HistoricDecisionExecution.xml +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/entity/HistoricDecisionExecution.xml @@ -77,7 +77,7 @@ - delete from ${prefix}ACT_DMN_HI_DECISION_EXECUTION where DEPLOYMENT_ID_ = #{deploymenId} + delete from ${prefix}ACT_DMN_HI_DECISION_EXECUTION where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} @@ -87,8 +87,8 @@ or INSTANCE_ID_ in - - #{item} + + #{instanceId, jdbcType=VARCHAR} ) @@ -96,7 +96,7 @@ and SCOPE_TYPE_ is null - and SCOPE_TYPE_ = #{scopeType} + and SCOPE_TYPE_ = #{scopeType, jdbcType=VARCHAR} @@ -161,56 +161,56 @@ inner join ${prefix}ACT_DMN_DECISION DEF on RES.DECISION_DEFINITION_ID_ = DEF.ID_ - RES.ID_ = #{id} + RES.ID_ = #{id, jdbcType=VARCHAR} and RES.ID_ in - - #{item} + + #{id, jdbcType=VARCHAR} - and RES.DECISION_DEFINITION_ID_ = #{decisionDefinitionId} + and RES.DECISION_DEFINITION_ID_ = #{decisionDefinitionId, jdbcType=VARCHAR} - and RES.DEPLOYMENT_ID_ = #{deploymentId} + and RES.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} - and DEF.KEY_ = #{decisionKey} + and DEF.KEY_ = #{decisionKey, jdbcType=VARCHAR} - and RES.INSTANCE_ID_ = #{instanceId} + and RES.INSTANCE_ID_ = #{instanceId, jdbcType=VARCHAR} - and RES.EXECUTION_ID_ = #{executionId} + and RES.EXECUTION_ID_ = #{executionId, jdbcType=VARCHAR} - and RES.ACTIVITY_ID_ = #{activityId} + and RES.ACTIVITY_ID_ = #{activityId, jdbcType=VARCHAR} - and RES.SCOPE_TYPE_ = #{scopeType} + and RES.SCOPE_TYPE_ = #{scopeType, jdbcType=VARCHAR} and RES.SCOPE_TYPE_ is null - and (RES.INSTANCE_ID_ = #{processInstanceIdWithChildren} or exists(select ELINK.ID_ from ${prefix}ACT_HI_ENTITYLINK ELINK where ELINK.LINK_TYPE_ = 'child' and - ELINK.SCOPE_ID_ = #{processInstanceIdWithChildren} AND ELINK.SCOPE_TYPE_ = 'bpmn' and + and (RES.INSTANCE_ID_ = #{processInstanceIdWithChildren, jdbcType=VARCHAR} or exists(select ELINK.ID_ from ${prefix}ACT_HI_ENTITYLINK ELINK where ELINK.LINK_TYPE_ = 'child' and + ELINK.SCOPE_ID_ = #{processInstanceIdWithChildren, jdbcType=VARCHAR} AND ELINK.SCOPE_TYPE_ = 'bpmn' and ELINK.REF_SCOPE_ID_ = RES.INSTANCE_ID_)) - and (RES.INSTANCE_ID_ = #{caseInstanceIdWithChildren} or exists(select ELINK.ID_ from ${prefix}ACT_HI_ENTITYLINK ELINK where ELINK.LINK_TYPE_ = 'child' and - ELINK.SCOPE_ID_ = #{caseInstanceIdWithChildren} AND ELINK.SCOPE_TYPE_ = 'cmmn' and + and (RES.INSTANCE_ID_ = #{caseInstanceIdWithChildren, jdbcType=VARCHAR} or exists(select ELINK.ID_ from ${prefix}ACT_HI_ENTITYLINK ELINK where ELINK.LINK_TYPE_ = 'child' and + ELINK.SCOPE_ID_ = #{caseInstanceIdWithChildren, jdbcType=VARCHAR} AND ELINK.SCOPE_TYPE_ = 'cmmn' and ELINK.REF_SCOPE_ID_ = RES.INSTANCE_ID_)) - and RES.FAILED_ = #{failed} + and RES.FAILED_ = #{failed, jdbcType=BOOLEAN} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=VARCHAR} and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java index 2a01c310245..18fe91b33a0 100755 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java @@ -932,9 +932,23 @@ public void initMybatisTypeHandlers(Configuration configuration) { handlerRegistry.register(Object.class, JdbcType.CHAR, new StringTypeHandler()); handlerRegistry.register(Object.class, JdbcType.CLOB, new ClobTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler()); + + // For SQL server, the performance difference between using varchar or nvarchar is big. + // Using the correct jdbcType is thus very important for SQL server, but in many mappings the type was not set, + // which led to defaulting to the regular 'varchar' jdbcType. + // Up to the point where the following if was added, none of the MyBatis mappings would use 'nvarchar' as jdbcType. + // Together with this check, all mappings were reviewed and the correct type was added. + if (databaseType.equals(DATABASE_TYPE_MSSQL)) { + handlerRegistry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler()); + handlerRegistry.register(Object.class, JdbcType.NVARCHAR, new NStringTypeHandler()); // Notice the 'N' prefix here + } else { + // However, for other databases, we want to keep the old behavior of always using 'varchar', + // thus the same handler is used for both types. + handlerRegistry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler()); + handlerRegistry.register(Object.class, JdbcType.NVARCHAR, new StringTypeHandler()); // Notice: no 'N' prefix here + } + handlerRegistry.register(Object.class, JdbcType.LONGVARCHAR, new StringTypeHandler()); - handlerRegistry.register(Object.class, JdbcType.NVARCHAR, new NStringTypeHandler()); handlerRegistry.register(Object.class, JdbcType.NCHAR, new NStringTypeHandler()); handlerRegistry.register(Object.class, JdbcType.NCLOB, new NClobTypeHandler()); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/ByteArray.xml b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/ByteArray.xml index f6bd935227c..4196853a18f 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/ByteArray.xml +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/ByteArray.xml @@ -9,11 +9,11 @@ insert into ${prefix}ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_) values ( - #{id, jdbcType=VARCHAR}, + #{id, jdbcType=NVARCHAR}, 1, - #{name, jdbcType=VARCHAR}, + #{name, jdbcType=NVARCHAR}, #{bytes, jdbcType=${blobType}}, - #{deploymentId, jdbcType=VARCHAR} + #{deploymentId, jdbcType=NVARCHAR} ) @@ -21,11 +21,11 @@ insert into ${prefix}ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_) values - (#{byteArray.id, jdbcType=VARCHAR}, + (#{byteArray.id, jdbcType=NVARCHAR}, 1, - #{byteArray.name, jdbcType=VARCHAR}, + #{byteArray.name, jdbcType=NVARCHAR}, #{byteArray.bytes, jdbcType=${blobType}}, - #{byteArray.deploymentId, jdbcType=VARCHAR}) + #{byteArray.deploymentId, jdbcType=NVARCHAR}) @@ -33,11 +33,11 @@ INSERT ALL into ${prefix}ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_) VALUES - (#{byteArray.id, jdbcType=VARCHAR}, + (#{byteArray.id, jdbcType=NVARCHAR}, 1, - #{byteArray.name, jdbcType=VARCHAR}, + #{byteArray.name, jdbcType=NVARCHAR}, #{byteArray.bytes, jdbcType=${blobType}}, - #{byteArray.deploymentId, jdbcType=VARCHAR}) + #{byteArray.deploymentId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -50,26 +50,26 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, BYTES_ = #{bytes, jdbcType=${blobType}}, - where ID_ = #{id} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_GE_BYTEARRAY where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_GE_BYTEARRAY where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_GE_BYTEARRAY where ID_ = #{id} + delete from ${prefix}ACT_GE_BYTEARRAY where ID_ = #{id, jdbcType=NVARCHAR} @@ -79,8 +79,8 @@ or ID_ in - - #{byteArrayId} + + #{id, jdbcType=NVARCHAR} @@ -88,11 +88,11 @@ - + - + - + @@ -102,7 +102,7 @@ diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml index 00a6102aaf3..2c598d5d3c9 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml @@ -12,8 +12,8 @@ VALUE_, REV_ ) values ( - #{name ,jdbcType=VARCHAR}, - #{value, jdbcType=VARCHAR}, + #{name, jdbcType=NVARCHAR}, + #{value, jdbcType=NVARCHAR}, 1 ) @@ -21,8 +21,8 @@ INSERT INTO ${prefix}ACT_GE_PROPERTY (NAME_, VALUE_, REV_) VALUES - (#{property.name ,jdbcType=VARCHAR}, - #{property.value, jdbcType=VARCHAR}, + (#{property.name, jdbcType=NVARCHAR}, + #{property.value, jdbcType=NVARCHAR}, 1) @@ -31,8 +31,8 @@ INSERT ALL INTO ${prefix}ACT_GE_PROPERTY (NAME_, VALUE_, REV_) VALUES - (#{property.name ,jdbcType=VARCHAR}, - #{property.value, jdbcType=VARCHAR}, + (#{property.name, jdbcType=NVARCHAR}, + #{property.value, jdbcType=NVARCHAR}, 1) SELECT * FROM dual @@ -44,8 +44,8 @@ VALUE_, REV_ ) values ( - #{name ,jdbcType=VARCHAR}, - #{value, jdbcType=VARCHAR}, + #{name, jdbcType=NVARCHAR}, + #{value, jdbcType=NVARCHAR}, 1 ) @@ -56,24 +56,24 @@ update ${prefix}ACT_GE_PROPERTY REV_ = #{revisionNext, jdbcType=INTEGER}, - VALUE_ = #{value, jdbcType=VARCHAR}, + VALUE_ = #{value, jdbcType=NVARCHAR}, - where NAME_ = #{name, jdbcType=VARCHAR} + where NAME_ = #{name, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_GE_PROPERTY where NAME_ = #{name} and REV_ = #{revision} + delete from ${prefix}ACT_GE_PROPERTY where NAME_ = #{name, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - - + + @@ -82,7 +82,7 @@ - select * from ${prefix}ACT_RU_ACTINST where ID_ = #{id} + select * from ${prefix}ACT_RU_ACTINST where ID_ = #{id, jdbcType=NVARCHAR} select * from ${prefix}ACT_RU_ACTINST RES - where EXECUTION_ID_ = #{parameter.executionId, jdbcType=VARCHAR} and ACT_ID_ = #{parameter.activityId, jdbcType=VARCHAR} and END_TIME_ is null + where EXECUTION_ID_ = #{parameter.executionId, jdbcType=NVARCHAR} and ACT_ID_ = #{parameter.activityId, jdbcType=NVARCHAR} and END_TIME_ is null diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Attachment.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Attachment.xml index 63c7db110a0..e8650b4a54c 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Attachment.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Attachment.xml @@ -23,16 +23,16 @@ insert into ${prefix}ACT_HI_ATTACHMENT (ID_, REV_, USER_ID_, NAME_, DESCRIPTION_, TYPE_, TASK_ID_, PROC_INST_ID_, URL_, CONTENT_ID_, TIME_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{userId ,jdbcType=VARCHAR}, - #{name ,jdbcType=VARCHAR}, - #{description ,jdbcType=VARCHAR}, - #{type ,jdbcType=VARCHAR}, - #{taskId ,jdbcType=VARCHAR}, - #{processInstanceId ,jdbcType=VARCHAR}, - #{url ,jdbcType=VARCHAR}, - #{contentId ,jdbcType=VARCHAR}, - #{time ,jdbcType=TIMESTAMP} + #{id, jdbcType=NVARCHAR}, + 1, #{userId, jdbcType=NVARCHAR}, + #{name, jdbcType=NVARCHAR}, + #{description, jdbcType=NVARCHAR}, + #{type, jdbcType=NVARCHAR}, + #{taskId, jdbcType=NVARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{url, jdbcType=NVARCHAR}, + #{contentId, jdbcType=NVARCHAR}, + #{time, jdbcType=TIMESTAMP} ) @@ -40,16 +40,16 @@ insert into ${prefix}ACT_HI_ATTACHMENT (ID_, REV_, USER_ID_, NAME_, DESCRIPTION_, TYPE_, TASK_ID_, PROC_INST_ID_, URL_, CONTENT_ID_, TIME_) values - (#{attachment.id ,jdbcType=VARCHAR}, - 1, #{attachment.userId ,jdbcType=VARCHAR}, - #{attachment.name ,jdbcType=VARCHAR}, - #{attachment.description ,jdbcType=VARCHAR}, - #{attachment.type ,jdbcType=VARCHAR}, - #{attachment.taskId ,jdbcType=VARCHAR}, - #{attachment.processInstanceId ,jdbcType=VARCHAR}, - #{attachment.url ,jdbcType=VARCHAR}, - #{attachment.contentId ,jdbcType=VARCHAR}, - #{attachment.time ,jdbcType=TIMESTAMP}) + (#{attachment.id, jdbcType=NVARCHAR}, + 1, #{attachment.userId, jdbcType=NVARCHAR}, + #{attachment.name, jdbcType=NVARCHAR}, + #{attachment.description, jdbcType=NVARCHAR}, + #{attachment.type, jdbcType=NVARCHAR}, + #{attachment.taskId, jdbcType=NVARCHAR}, + #{attachment.processInstanceId, jdbcType=NVARCHAR}, + #{attachment.url, jdbcType=NVARCHAR}, + #{attachment.contentId, jdbcType=NVARCHAR}, + #{attachment.time, jdbcType=TIMESTAMP}) @@ -57,16 +57,16 @@ INSERT ALL INTO ${prefix}ACT_HI_ATTACHMENT (ID_, REV_, USER_ID_, NAME_, DESCRIPTION_, TYPE_, TASK_ID_, PROC_INST_ID_, URL_, CONTENT_ID_, TIME_) VALUES - (#{attachment.id ,jdbcType=VARCHAR}, - 1, #{attachment.userId ,jdbcType=VARCHAR}, - #{attachment.name ,jdbcType=VARCHAR}, - #{attachment.description ,jdbcType=VARCHAR}, - #{attachment.type ,jdbcType=VARCHAR}, - #{attachment.taskId ,jdbcType=VARCHAR}, - #{attachment.processInstanceId ,jdbcType=VARCHAR}, - #{attachment.url ,jdbcType=VARCHAR}, - #{attachment.contentId ,jdbcType=VARCHAR}, - #{attachment.time ,jdbcType=TIMESTAMP}) + (#{attachment.id, jdbcType=NVARCHAR}, + 1, #{attachment.userId, jdbcType=NVARCHAR}, + #{attachment.name, jdbcType=NVARCHAR}, + #{attachment.description, jdbcType=NVARCHAR}, + #{attachment.type, jdbcType=NVARCHAR}, + #{attachment.taskId, jdbcType=NVARCHAR}, + #{attachment.processInstanceId, jdbcType=NVARCHAR}, + #{attachment.url, jdbcType=NVARCHAR}, + #{attachment.contentId, jdbcType=NVARCHAR}, + #{attachment.time, jdbcType=TIMESTAMP}) SELECT * FROM dual @@ -78,13 +78,13 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, - NAME_ = #{name, jdbcType=VARCHAR}, + NAME_ = #{name, jdbcType=NVARCHAR}, - DESCRIPTION_ = #{description, jdbcType=TIMESTAMP}, + DESCRIPTION_ = #{description, jdbcType=NVARCHAR}, - where ID_ = #{id} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} @@ -92,22 +92,22 @@ delete from ${prefix}ACT_HI_ATTACHMENT - where ID_ = #{id} and REV_ = #{revision} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - + - - - - - - - - + + + + + + + + @@ -116,20 +116,20 @@ @@ -144,8 +144,8 @@ or ATTACHMENT_.TASK_ID_ in - - #{item} + + #{taskId, jdbcType=NVARCHAR} ) @@ -158,8 +158,8 @@ or TASK_ID_ in - - #{item} + + #{taskId, jdbcType=NVARCHAR} diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Comment.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Comment.xml index 184f68cc5c1..d9a6fa463a9 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Comment.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Comment.xml @@ -22,30 +22,30 @@ insert into ${prefix}ACT_HI_COMMENT (ID_, TYPE_, TIME_, USER_ID_, TASK_ID_, PROC_INST_ID_, ACTION_, MESSAGE_, FULL_MSG_) - values (#{id ,jdbcType=VARCHAR}, - #{type ,jdbcType=VARCHAR}, - #{time ,jdbcType=TIMESTAMP}, - #{userId ,jdbcType=VARCHAR}, - #{taskId ,jdbcType=VARCHAR}, - #{processInstanceId ,jdbcType=VARCHAR}, - #{action ,jdbcType=VARCHAR}, - #{message ,jdbcType=VARCHAR}, - #{fullMessageBytes ,jdbcType=${blobType}}) + values (#{id, jdbcType=NVARCHAR}, + #{type, jdbcType=NVARCHAR}, + #{time, jdbcType=TIMESTAMP}, + #{userId, jdbcType=NVARCHAR}, + #{taskId, jdbcType=NVARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{action, jdbcType=NVARCHAR}, + #{message, jdbcType=NVARCHAR}, + #{fullMessageBytes, jdbcType=${blobType}}) insert into ${prefix}ACT_HI_COMMENT (ID_, TYPE_, TIME_, USER_ID_, TASK_ID_, PROC_INST_ID_, ACTION_, MESSAGE_, FULL_MSG_) values - (#{comment.id ,jdbcType=VARCHAR}, - #{comment.type ,jdbcType=VARCHAR}, - #{comment.time ,jdbcType=TIMESTAMP}, - #{comment.userId ,jdbcType=VARCHAR}, - #{comment.taskId ,jdbcType=VARCHAR}, - #{comment.processInstanceId ,jdbcType=VARCHAR}, - #{comment.action ,jdbcType=VARCHAR}, - #{comment.message ,jdbcType=VARCHAR}, - #{comment.fullMessageBytes ,jdbcType=${blobType}}) + (#{comment.id, jdbcType=NVARCHAR}, + #{comment.type, jdbcType=NVARCHAR}, + #{comment.time, jdbcType=TIMESTAMP}, + #{comment.userId, jdbcType=NVARCHAR}, + #{comment.taskId, jdbcType=NVARCHAR}, + #{comment.processInstanceId, jdbcType=NVARCHAR}, + #{comment.action, jdbcType=NVARCHAR}, + #{comment.message, jdbcType=NVARCHAR}, + #{comment.fullMessageBytes, jdbcType=${blobType}}) @@ -53,15 +53,15 @@ INSERT ALL into ${prefix}ACT_HI_COMMENT (ID_, TYPE_, TIME_, USER_ID_, TASK_ID_, PROC_INST_ID_, ACTION_, MESSAGE_, FULL_MSG_) VALUES - (#{comment.id ,jdbcType=VARCHAR}, - #{comment.type ,jdbcType=VARCHAR}, - #{comment.time ,jdbcType=TIMESTAMP}, - #{comment.userId ,jdbcType=VARCHAR}, - #{comment.taskId ,jdbcType=VARCHAR}, - #{comment.processInstanceId ,jdbcType=VARCHAR}, - #{comment.action ,jdbcType=VARCHAR}, - #{comment.message ,jdbcType=VARCHAR}, - #{comment.fullMessageBytes ,jdbcType=${blobType}}) + (#{comment.id, jdbcType=NVARCHAR}, + #{comment.type, jdbcType=NVARCHAR}, + #{comment.time, jdbcType=TIMESTAMP}, + #{comment.userId, jdbcType=NVARCHAR}, + #{comment.taskId, jdbcType=NVARCHAR}, + #{comment.processInstanceId, jdbcType=NVARCHAR}, + #{comment.action, jdbcType=NVARCHAR}, + #{comment.message, jdbcType=NVARCHAR}, + #{comment.fullMessageBytes, jdbcType=${blobType}}) SELECT * FROM dual @@ -71,29 +71,29 @@ update ${prefix}ACT_HI_COMMENT - TYPE_ = #{type, jdbcType=VARCHAR}, + TYPE_ = #{type, jdbcType=NVARCHAR}, TIME_ = #{time, jdbcType=TIMESTAMP}, - USER_ID_ = #{userId, jdbcType=VARCHAR}, - TASK_ID_ = #{taskId, jdbcType=VARCHAR}, - PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}, - MESSAGE_ = #{message, jdbcType=VARCHAR}, + USER_ID_ = #{userId, jdbcType=NVARCHAR}, + TASK_ID_ = #{taskId, jdbcType=NVARCHAR}, + PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR}, + MESSAGE_ = #{message, jdbcType=NVARCHAR}, FULL_MSG_ = #{fullMessageBytes, jdbcType=${blobType}}, - where ID_ = #{id, jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_COMMENT where ID_ = #{id} + delete from ${prefix}ACT_HI_COMMENT where ID_ = #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_COMMENT where TASK_ID_ = #{taskId} + delete from ${prefix}ACT_HI_COMMENT where TASK_ID_ = #{taskId, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_COMMENT where PROC_INST_ID_ = #{processInstanceId} + delete from ${prefix}ACT_HI_COMMENT where PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR} @@ -103,8 +103,8 @@ or TASK_ID_ in - - #{item} + + #{taskId, jdbcType=NVARCHAR} @@ -116,8 +116,8 @@ or PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} @@ -125,14 +125,14 @@ - - - + + + - - - - + + + + @@ -141,13 +141,13 @@ @@ -155,44 +155,44 @@ diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Deployment.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Deployment.xml index bdef5b53d7b..4cf8ca6af0f 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Deployment.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Deployment.xml @@ -8,23 +8,23 @@ insert into ${prefix}ACT_RE_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, DERIVED_FROM_, DERIVED_FROM_ROOT_, PARENT_DEPLOYMENT_ID_, ENGINE_VERSION_) - values(#{id, jdbcType=VARCHAR}, #{name, jdbcType=VARCHAR}, #{category, jdbcType=VARCHAR}, #{key, jdbcType=VARCHAR}, #{tenantId, jdbcType=VARCHAR}, #{deploymentTime, jdbcType=TIMESTAMP}, #{derivedFrom, jdbcType=VARCHAR}, #{derivedFromRoot, jdbcType=VARCHAR}, #{parentDeploymentId, jdbcType=VARCHAR}, #{engineVersion, jdbcType=VARCHAR}) + values(#{id, jdbcType=NVARCHAR}, #{name, jdbcType=NVARCHAR}, #{category, jdbcType=NVARCHAR}, #{key, jdbcType=NVARCHAR}, #{tenantId, jdbcType=NVARCHAR}, #{deploymentTime, jdbcType=TIMESTAMP}, #{derivedFrom, jdbcType=NVARCHAR}, #{derivedFromRoot, jdbcType=NVARCHAR}, #{parentDeploymentId, jdbcType=NVARCHAR}, #{engineVersion, jdbcType=NVARCHAR}) insert into ${prefix}ACT_RE_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, DERIVED_FROM_, DERIVED_FROM_ROOT_, PARENT_DEPLOYMENT_ID_, ENGINE_VERSION_) values - (#{deployment.id, jdbcType=VARCHAR}, - #{deployment.name, jdbcType=VARCHAR}, - #{deployment.category, jdbcType=VARCHAR}, - #{deployment.key, jdbcType=VARCHAR}, - #{deployment.tenantId, jdbcType=VARCHAR}, + (#{deployment.id, jdbcType=NVARCHAR}, + #{deployment.name, jdbcType=NVARCHAR}, + #{deployment.category, jdbcType=NVARCHAR}, + #{deployment.key, jdbcType=NVARCHAR}, + #{deployment.tenantId, jdbcType=NVARCHAR}, #{deployment.deploymentTime, jdbcType=TIMESTAMP}, - #{deployment.derivedFrom, jdbcType=VARCHAR}, - #{deployment.derivedFromRoot, jdbcType=VARCHAR}, - #{deployment.parentDeploymentId, jdbcType=VARCHAR}, - #{deployment.engineVersion, jdbcType=VARCHAR}) + #{deployment.derivedFrom, jdbcType=NVARCHAR}, + #{deployment.derivedFromRoot, jdbcType=NVARCHAR}, + #{deployment.parentDeploymentId, jdbcType=NVARCHAR}, + #{deployment.engineVersion, jdbcType=NVARCHAR}) @@ -32,16 +32,16 @@ INSERT ALL into ${prefix}ACT_RE_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, DERIVED_FROM_, DERIVED_FROM_ROOT_, PARENT_DEPLOYMENT_ID_, ENGINE_VERSION_) VALUES - (#{deployment.id, jdbcType=VARCHAR}, - #{deployment.name, jdbcType=VARCHAR}, - #{deployment.category, jdbcType=VARCHAR}, - #{deployment.key, jdbcType=VARCHAR}, - #{deployment.tenantId, jdbcType=VARCHAR}, + (#{deployment.id, jdbcType=NVARCHAR}, + #{deployment.name, jdbcType=NVARCHAR}, + #{deployment.category, jdbcType=NVARCHAR}, + #{deployment.key, jdbcType=NVARCHAR}, + #{deployment.tenantId, jdbcType=NVARCHAR}, #{deployment.deploymentTime, jdbcType=TIMESTAMP}, - #{deployment.derivedFrom, jdbcType=VARCHAR}, - #{deployment.derivedFromRoot, jdbcType=VARCHAR}, - #{deployment.parentDeploymentId, jdbcType=VARCHAR}, - #{deployment.engineVersion, jdbcType=VARCHAR}) + #{deployment.derivedFrom, jdbcType=NVARCHAR}, + #{deployment.derivedFromRoot, jdbcType=NVARCHAR}, + #{deployment.parentDeploymentId, jdbcType=NVARCHAR}, + #{deployment.engineVersion, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -52,40 +52,40 @@ update ${prefix}ACT_RE_DEPLOYMENT - CATEGORY_ = #{category, jdbcType=VARCHAR}, + CATEGORY_ = #{category, jdbcType=NVARCHAR}, - KEY_ = #{key, jdbcType=VARCHAR}, + KEY_ = #{key, jdbcType=NVARCHAR}, - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}, + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR}, - PARENT_DEPLOYMENT_ID_ = #{parentDeploymentId, jdbcType=VARCHAR}, + PARENT_DEPLOYMENT_ID_ = #{parentDeploymentId, jdbcType=NVARCHAR}, - where ID_ = #{id, jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RE_DEPLOYMENT where ID_ = #{id} + delete from ${prefix}ACT_RE_DEPLOYMENT where ID_ = #{id, jdbcType=NVARCHAR} - - - - - + + + + + - - - - + + + + @@ -107,87 +107,87 @@ from ${prefix}ACT_RE_DEPLOYMENT RES - RES.ID_ = #{deploymentId} + RES.ID_ = #{deploymentId, jdbcType=NVARCHAR} and RES.ID_ IN - #{deploymentId} + #{deploymentId, jdbcType=NVARCHAR} - and RES.NAME_ = #{name} + and RES.NAME_ = #{name, jdbcType=NVARCHAR} - and RES.NAME_ like #{nameLike}${wildcardEscapeClause} + and RES.NAME_ like #{nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.CATEGORY_ = #{category} + and RES.CATEGORY_ = #{category, jdbcType=NVARCHAR} - and RES.CATEGORY_ like #{categoryLike}${wildcardEscapeClause} + and RES.CATEGORY_ like #{categoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and ( RES.CATEGORY_ <> #{categoryNotEquals} OR RES.CATEGORY_ is null ) + and ( RES.CATEGORY_ <> #{categoryNotEquals, jdbcType=NVARCHAR} OR RES.CATEGORY_ is null ) - and RES.KEY_ = #{key} + and RES.KEY_ = #{key, jdbcType=NVARCHAR} - and RES.KEY_ like #{keyLike}${wildcardEscapeClause} + and RES.KEY_ like #{keyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) - and (RES.DERIVED_FROM_ = #{derivedFrom} or RES.DERIVED_FROM_ROOT_ = #{derivedFrom}) + and (RES.DERIVED_FROM_ = #{derivedFrom, jdbcType=NVARCHAR} or RES.DERIVED_FROM_ROOT_ = #{derivedFrom, jdbcType=NVARCHAR}) - and (RES.PARENT_DEPLOYMENT_ID_ = #{parentDeploymentId}) + and (RES.PARENT_DEPLOYMENT_ID_ = #{parentDeploymentId, jdbcType=NVARCHAR}) - and RES.PARENT_DEPLOYMENT_ID_ like #{parentDeploymentIdLike}${wildcardEscapeClause} + and RES.PARENT_DEPLOYMENT_ID_ like #{parentDeploymentIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and RES.PARENT_DEPLOYMENT_ID_ IN - #{parentDeploymentId} + #{parentDeploymentId, jdbcType=NVARCHAR} - and RES.ENGINE_VERSION_ = #{engineVersion} + and RES.ENGINE_VERSION_ = #{engineVersion, jdbcType=NVARCHAR} and exists(select 1 from ${prefix}ACT_RE_PROCDEF PROCDEF where RES.ID_ = PROCDEF.DEPLOYMENT_ID_ - and PROCDEF.KEY_ = #{processDefinitionKey} + and PROCDEF.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR} - and PROCDEF.KEY_ like #{processDefinitionKeyLike}${wildcardEscapeClause} + and PROCDEF.KEY_ like #{processDefinitionKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} ) and RES.DEPLOY_TIME_ = (select max(DEPLOY_TIME_) from ${prefix}ACT_RE_DEPLOYMENT where KEY_ = RES.KEY_ - and (DERIVED_FROM_ = #{derivedFrom} or DERIVED_FROM_ROOT_ = #{derivedFrom}) + and (DERIVED_FROM_ = #{derivedFrom, jdbcType=NVARCHAR} or DERIVED_FROM_ROOT_ = #{derivedFrom, jdbcType=NVARCHAR}) and DERIVED_FROM_ is null - and TENANT_ID_ = #{tenantId} + and TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (TENANT_ID_ = '' or TENANT_ID_ is null) @@ -201,7 +201,7 @@ select * from ${prefix}ACT_EVT_LOG - WHERE LOG_NR_ > #{parameter.startLogNr} - AND LOG_NR_ < #{parameter.endLogNr} + WHERE LOG_NR_ > #{parameter.startLogNr, jdbcType=BIGINT} + AND LOG_NR_ < #{parameter.endLogNr, jdbcType=BIGINT} ORDER BY LOG_NR_ - delete from ${prefix}ACT_EVT_LOG where LOG_NR_ = #{logNr} + delete from ${prefix}ACT_EVT_LOG where LOG_NR_ = #{logNr, jdbcType=BIGINT} \ No newline at end of file diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml index c057801d937..17ae1b2d572 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml @@ -13,25 +13,25 @@ TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, EXTERNAL_WORKER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, PROPAGATED_STAGE_INST_ID_, BUSINESS_STATUS_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{processInstanceId, jdbcType=VARCHAR}, - #{businessKey, jdbcType=VARCHAR}, - #{processDefinitionId ,jdbcType=VARCHAR}, - #{activityId ,jdbcType=VARCHAR}, - #{isActive ,jdbcType=BOOLEAN}, - #{isConcurrent ,jdbcType=BOOLEAN}, - #{isScope ,jdbcType=BOOLEAN}, - #{isEventScope ,jdbcType=BOOLEAN}, + #{id, jdbcType=NVARCHAR}, + 1, #{processInstanceId, jdbcType=NVARCHAR}, + #{businessKey, jdbcType=NVARCHAR}, + #{processDefinitionId, jdbcType=NVARCHAR}, + #{activityId, jdbcType=NVARCHAR}, + #{isActive, jdbcType=BOOLEAN}, + #{isConcurrent, jdbcType=BOOLEAN}, + #{isScope, jdbcType=BOOLEAN}, + #{isEventScope, jdbcType=BOOLEAN}, #{isMultiInstanceRoot, jdbcType=BOOLEAN}, - #{parentId, jdbcType=VARCHAR}, - #{superExecutionId, jdbcType=VARCHAR}, - #{rootProcessInstanceId, jdbcType=VARCHAR}, + #{parentId, jdbcType=NVARCHAR}, + #{superExecutionId, jdbcType=NVARCHAR}, + #{rootProcessInstanceId, jdbcType=NVARCHAR}, #{suspensionState, jdbcType=INTEGER}, - #{tenantId, jdbcType=VARCHAR}, - #{name, jdbcType=VARCHAR}, - #{startActivityId, jdbcType=VARCHAR}, + #{tenantId, jdbcType=NVARCHAR}, + #{name, jdbcType=NVARCHAR}, + #{startActivityId, jdbcType=NVARCHAR}, #{startTime, jdbcType=TIMESTAMP}, - #{startUserId, jdbcType=VARCHAR}, + #{startUserId, jdbcType=NVARCHAR}, #{isCountEnabled, jdbcType=BOOLEAN}, #{eventSubscriptionCount, jdbcType=INTEGER}, #{taskCount, jdbcType=INTEGER}, @@ -42,12 +42,12 @@ #{externalWorkerJobCount, jdbcType=INTEGER}, #{variableCount, jdbcType=INTEGER}, #{identityLinkCount, jdbcType=INTEGER}, - #{callbackId, jdbcType=VARCHAR}, - #{callbackType, jdbcType=VARCHAR}, - #{referenceId, jdbcType=VARCHAR}, - #{referenceType, jdbcType=VARCHAR}, - #{propagatedStageInstanceId, jdbcType=VARCHAR}, - #{businessStatus, jdbcType=VARCHAR} + #{callbackId, jdbcType=NVARCHAR}, + #{callbackType, jdbcType=NVARCHAR}, + #{referenceId, jdbcType=NVARCHAR}, + #{referenceType, jdbcType=NVARCHAR}, + #{propagatedStageInstanceId, jdbcType=NVARCHAR}, + #{businessStatus, jdbcType=NVARCHAR} ) @@ -59,25 +59,25 @@ CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, PROPAGATED_STAGE_INST_ID_, BUSINESS_STATUS_) values - (#{execution.id ,jdbcType=VARCHAR}, - 1, #{execution.processInstanceId, jdbcType=VARCHAR}, - #{execution.businessKey, jdbcType=VARCHAR}, - #{execution.processDefinitionId ,jdbcType=VARCHAR}, - #{execution.activityId ,jdbcType=VARCHAR}, - #{execution.isActive ,jdbcType=BOOLEAN}, - #{execution.isConcurrent ,jdbcType=BOOLEAN}, - #{execution.isScope ,jdbcType=BOOLEAN}, - #{execution.isEventScope ,jdbcType=BOOLEAN}, + (#{execution.id, jdbcType=NVARCHAR}, + 1, #{execution.processInstanceId, jdbcType=NVARCHAR}, + #{execution.businessKey, jdbcType=NVARCHAR}, + #{execution.processDefinitionId, jdbcType=NVARCHAR}, + #{execution.activityId, jdbcType=NVARCHAR}, + #{execution.isActive, jdbcType=BOOLEAN}, + #{execution.isConcurrent, jdbcType=BOOLEAN}, + #{execution.isScope, jdbcType=BOOLEAN}, + #{execution.isEventScope, jdbcType=BOOLEAN}, #{execution.isMultiInstanceRoot, jdbcType=BOOLEAN}, - #{execution.parentId, jdbcType=VARCHAR}, - #{execution.superExecutionId, jdbcType=VARCHAR}, - #{execution.rootProcessInstanceId, jdbcType=VARCHAR}, + #{execution.parentId, jdbcType=NVARCHAR}, + #{execution.superExecutionId, jdbcType=NVARCHAR}, + #{execution.rootProcessInstanceId, jdbcType=NVARCHAR}, #{execution.suspensionState, jdbcType=INTEGER}, - #{execution.tenantId, jdbcType=VARCHAR}, - #{execution.name, jdbcType=VARCHAR}, - #{execution.startActivityId, jdbcType=VARCHAR}, + #{execution.tenantId, jdbcType=NVARCHAR}, + #{execution.name, jdbcType=NVARCHAR}, + #{execution.startActivityId, jdbcType=NVARCHAR}, #{execution.startTime, jdbcType=TIMESTAMP}, - #{execution.startUserId, jdbcType=VARCHAR}, + #{execution.startUserId, jdbcType=NVARCHAR}, #{execution.isCountEnabled, jdbcType=BOOLEAN}, #{execution.eventSubscriptionCount, jdbcType=INTEGER}, #{execution.taskCount, jdbcType=INTEGER}, @@ -88,12 +88,12 @@ #{execution.externalWorkerJobCount, jdbcType=INTEGER}, #{execution.variableCount, jdbcType=INTEGER}, #{execution.identityLinkCount, jdbcType=INTEGER}, - #{execution.callbackId, jdbcType=VARCHAR}, - #{execution.callbackType, jdbcType=VARCHAR}, - #{execution.referenceId, jdbcType=VARCHAR}, - #{execution.referenceType, jdbcType=VARCHAR}, - #{execution.propagatedStageInstanceId, jdbcType=VARCHAR}, - #{execution.businessStatus, jdbcType=VARCHAR} + #{execution.callbackId, jdbcType=NVARCHAR}, + #{execution.callbackType, jdbcType=NVARCHAR}, + #{execution.referenceId, jdbcType=NVARCHAR}, + #{execution.referenceType, jdbcType=NVARCHAR}, + #{execution.propagatedStageInstanceId, jdbcType=NVARCHAR}, + #{execution.businessStatus, jdbcType=NVARCHAR} ) @@ -107,25 +107,25 @@ TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, EXTERNAL_WORKER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_, CALLBACK_ID_, CALLBACK_TYPE_, REFERENCE_ID_, REFERENCE_TYPE_, PROPAGATED_STAGE_INST_ID_, BUSINESS_STATUS_) VALUES ( - #{execution.id ,jdbcType=VARCHAR}, - 1, #{execution.processInstanceId, jdbcType=VARCHAR}, - #{execution.businessKey, jdbcType=VARCHAR}, - #{execution.processDefinitionId ,jdbcType=VARCHAR}, - #{execution.activityId ,jdbcType=VARCHAR}, - #{execution.isActive ,jdbcType=BOOLEAN}, - #{execution.isConcurrent ,jdbcType=BOOLEAN}, - #{execution.isScope ,jdbcType=BOOLEAN}, - #{execution.isEventScope ,jdbcType=BOOLEAN}, + #{execution.id, jdbcType=NVARCHAR}, + 1, #{execution.processInstanceId, jdbcType=NVARCHAR}, + #{execution.businessKey, jdbcType=NVARCHAR}, + #{execution.processDefinitionId, jdbcType=NVARCHAR}, + #{execution.activityId, jdbcType=NVARCHAR}, + #{execution.isActive, jdbcType=BOOLEAN}, + #{execution.isConcurrent, jdbcType=BOOLEAN}, + #{execution.isScope, jdbcType=BOOLEAN}, + #{execution.isEventScope, jdbcType=BOOLEAN}, #{execution.isMultiInstanceRoot, jdbcType=BOOLEAN}, - #{execution.parentId, jdbcType=VARCHAR}, - #{execution.superExecutionId, jdbcType=VARCHAR}, - #{execution.rootProcessInstanceId, jdbcType=VARCHAR}, + #{execution.parentId, jdbcType=NVARCHAR}, + #{execution.superExecutionId, jdbcType=NVARCHAR}, + #{execution.rootProcessInstanceId, jdbcType=NVARCHAR}, #{execution.suspensionState, jdbcType=INTEGER}, - #{execution.tenantId, jdbcType=VARCHAR}, - #{execution.name, jdbcType=VARCHAR}, - #{execution.startActivityId, jdbcType=VARCHAR}, + #{execution.tenantId, jdbcType=NVARCHAR}, + #{execution.name, jdbcType=NVARCHAR}, + #{execution.startActivityId, jdbcType=NVARCHAR}, #{execution.startTime, jdbcType=TIMESTAMP}, - #{execution.startUserId, jdbcType=VARCHAR}, + #{execution.startUserId, jdbcType=NVARCHAR}, #{execution.isCountEnabled, jdbcType=BOOLEAN}, #{execution.eventSubscriptionCount, jdbcType=INTEGER}, #{execution.taskCount, jdbcType=INTEGER}, @@ -136,12 +136,12 @@ #{execution.externalWorkerJobCount, jdbcType=INTEGER}, #{execution.variableCount, jdbcType=INTEGER}, #{execution.identityLinkCount, jdbcType=INTEGER}, - #{execution.callbackId, jdbcType=VARCHAR}, - #{execution.callbackType, jdbcType=VARCHAR}, - #{execution.referenceId, jdbcType=VARCHAR}, - #{execution.referenceType, jdbcType=VARCHAR}, - #{execution.propagatedStageInstanceId, jdbcType=VARCHAR}, - #{execution.businessStatus, jdbcType=VARCHAR} + #{execution.callbackId, jdbcType=NVARCHAR}, + #{execution.callbackType, jdbcType=NVARCHAR}, + #{execution.referenceId, jdbcType=NVARCHAR}, + #{execution.referenceType, jdbcType=NVARCHAR}, + #{execution.propagatedStageInstanceId, jdbcType=NVARCHAR}, + #{execution.businessStatus, jdbcType=NVARCHAR} ) SELECT * FROM dual @@ -154,13 +154,13 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, - BUSINESS_KEY_ = #{businessKey, jdbcType=VARCHAR}, + BUSINESS_KEY_ = #{businessKey, jdbcType=NVARCHAR}, - PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}, + PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR}, - ACT_ID_ = #{activityId, jdbcType=VARCHAR}, + ACT_ID_ = #{activityId, jdbcType=NVARCHAR}, IS_ACTIVE_ = #{isActive, jdbcType=BOOLEAN}, @@ -178,19 +178,19 @@ IS_MI_ROOT_ = #{isMultiInstanceRoot, jdbcType=BOOLEAN}, - PARENT_ID_ = #{parentId, jdbcType=VARCHAR}, + PARENT_ID_ = #{parentId, jdbcType=NVARCHAR}, - SUPER_EXEC_ = #{superExecutionId, jdbcType=VARCHAR}, + SUPER_EXEC_ = #{superExecutionId, jdbcType=NVARCHAR}, - ROOT_PROC_INST_ID_ = #{rootProcessInstanceId, jdbcType=VARCHAR}, + ROOT_PROC_INST_ID_ = #{rootProcessInstanceId, jdbcType=NVARCHAR}, SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER}, - NAME_ = #{name, jdbcType=VARCHAR}, + NAME_ = #{name, jdbcType=NVARCHAR}, IS_COUNT_ENABLED_ = #{isCountEnabled, jdbcType=BOOLEAN}, @@ -223,37 +223,37 @@ ID_LINK_COUNT_ = #{identityLinkCount, jdbcType=INTEGER}, - CALLBACK_ID_ = #{callbackId, jdbcType=VARCHAR}, + CALLBACK_ID_ = #{callbackId, jdbcType=NVARCHAR}, - CALLBACK_ID_ = #{callbackType, jdbcType=VARCHAR}, + CALLBACK_ID_ = #{callbackType, jdbcType=NVARCHAR}, - REFERENCE_ID_ = #{referenceId, jdbcType=VARCHAR}, + REFERENCE_ID_ = #{referenceId, jdbcType=NVARCHAR}, - REFERENCE_TYPE_ = #{referenceType, jdbcType=VARCHAR}, + REFERENCE_TYPE_ = #{referenceType, jdbcType=NVARCHAR}, - PROPAGATED_STAGE_INST_ID_ = #{propagatedStageInstanceId, jdbcType=VARCHAR}, + PROPAGATED_STAGE_INST_ID_ = #{propagatedStageInstanceId, jdbcType=NVARCHAR}, - BUSINESS_STATUS_ = #{businessStatus, jdbcType=VARCHAR}, + BUSINESS_STATUS_ = #{businessStatus, jdbcType=NVARCHAR}, - where ID_ = #{id, jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} update ${prefix}ACT_RU_EXECUTION set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( SELECT E.ID_ from ${prefix}ACT_RU_EXECUTION E inner join ${prefix}ACT_RE_PROCDEF P on E.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) @@ -261,7 +261,7 @@ Tested this on MySQL 5.6: does NOT use a temporary table (so good, performance) --> update ${prefix}ACT_RU_EXECUTION set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( @@ -271,7 +271,7 @@ FROM ${prefix}ACT_RU_EXECUTION E inner join ${prefix}ACT_RE_PROCDEF P on E.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) AS tempExecution @@ -282,8 +282,8 @@ update ${prefix}ACT_RU_EXECUTION set LOCK_TIME_ = #{lockTime, jdbcType=TIMESTAMP}, - LOCK_OWNER_ = #{lockOwner, jdbcType=VARCHAR} - where ID_ = #{id} + LOCK_OWNER_ = #{lockOwner, jdbcType=NVARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} and (LOCK_TIME_ is null OR LOCK_TIME_ < #{expirationTime, jdbcType=TIMESTAMP}) @@ -292,7 +292,7 @@ set LOCK_TIME_ = null, LOCK_OWNER_ = null - where ID_ = #{id} + where ID_ = #{id, jdbcType=NVARCHAR} @@ -300,7 +300,7 @@ set LOCK_TIME_ = null, LOCK_OWNER_ = null - where LOCK_OWNER_ = #{lockOwner, jdbcType=VARCHAR} + where LOCK_OWNER_ = #{lockOwner, jdbcType=NVARCHAR} @@ -311,40 +311,40 @@ - delete from ${prefix}ACT_RU_EXECUTION where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_RU_EXECUTION where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} delete from ${prefix}ACT_RU_EXECUTION where - ID_ = #{execution.id, jdbcType=VARCHAR} + ID_ = #{execution.id, jdbcType=NVARCHAR} - + - - - - - + + + + + - - - + + + - - - + + + - + @@ -355,45 +355,45 @@ - - - - - + + + + + - + - - - + + + - - - + + + - - + + - + - - - + + + - - + + - - + + - + @@ -404,35 +404,35 @@ - - - - - + + + + + - + - - - - - + + + + + - - - + + + - - - + + + - + @@ -443,57 +443,57 @@ - - - - - + + + + + - - - + + + - - - - + + + + - - + + - + - - - - - - + + + + + + - - - + + + - - - + + + - - + + - - + + - + @@ -504,24 +504,24 @@ - - - - - + + + + + - - - + + + - - - - + + + + - - + + @@ -530,67 +530,67 @@ @@ -668,48 +668,48 @@ RES.PARENT_ID_ is null - and P.ID_ = #{processDefinitionId} + and P.ID_ = #{processDefinitionId, jdbcType=NVARCHAR} and P.ID_ in - - #{item} + + #{processDefinitionId, jdbcType=NVARCHAR} - and P.KEY_ = #{processDefinitionKey} + and P.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR} and P.KEY_ in - - #{item} + + #{processDefinitionKey, jdbcType=NVARCHAR} - and P.CATEGORY_ = #{processDefinitionCategory} + and P.CATEGORY_ = #{processDefinitionCategory, jdbcType=NVARCHAR} - and P.NAME_ = #{processDefinitionName} + and P.NAME_ = #{processDefinitionName, jdbcType=NVARCHAR} - and P.VERSION_ = #{processDefinitionVersion} + and P.VERSION_ = #{processDefinitionVersion, jdbcType=INTEGER} - and P.ENGINE_VERSION_ = #{processDefinitionEngineVersion} + and P.ENGINE_VERSION_ = #{processDefinitionEngineVersion, jdbcType=NVARCHAR} - and RES.ID_ = #{executionId} + and RES.ID_ = #{executionId, jdbcType=NVARCHAR} - and RES.PROC_INST_ID_ = #{processInstanceId} + and RES.PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR} - and RES.ROOT_PROC_INST_ID_ = #{rootProcessInstanceId} + and RES.ROOT_PROC_INST_ID_ = #{rootProcessInstanceId, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} @@ -721,35 +721,35 @@ RES.PROC_INST_ID_ = INST.ID_ - and INST.BUSINESS_KEY_ = #{businessKey} + and INST.BUSINESS_KEY_ = #{businessKey, jdbcType=NVARCHAR} - and INST.BUSINESS_KEY_ like #{businessKeyLike}${wildcardEscapeClause} + and INST.BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} ) - and RES.BUSINESS_KEY_ = #{businessKey} + and RES.BUSINESS_KEY_ = #{businessKey, jdbcType=NVARCHAR} - and RES.BUSINESS_KEY_ like #{businessKeyLike}${wildcardEscapeClause} + and RES.BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.BUSINESS_STATUS_ = #{businessStatus} + and RES.BUSINESS_STATUS_ = #{businessStatus, jdbcType=NVARCHAR} - and RES.BUSINESS_STATUS_ like #{businessStatusLike}${wildcardEscapeClause} + and RES.BUSINESS_STATUS_ like #{businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.ACT_ID_ = #{activityId} and RES.IS_ACTIVE_ = #{isActive} + and RES.ACT_ID_ = #{activityId, jdbcType=NVARCHAR} and RES.IS_ACTIVE_ = #{isActive, jdbcType=BOOLEAN} - and RES.PARENT_ID_ = #{parentId} + and RES.PARENT_ID_ = #{parentId, jdbcType=NVARCHAR} and RES.PARENT_ID_ is not null @@ -761,22 +761,22 @@ and RES.PARENT_ID_ is null - and P.DEPLOYMENT_ID_ = #{deploymentId} + and P.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=NVARCHAR} and P.DEPLOYMENT_ID_ IN - - #{deployment} + #{deploymentId, jdbcType=NVARCHAR} - and RES.SUPER_EXEC_ IN (select ID_ from ${prefix}ACT_RU_EXECUTION where PROC_INST_ID_ = #{superProcessInstanceId}) + and RES.SUPER_EXEC_ IN (select ID_ from ${prefix}ACT_RU_EXECUTION where PROC_INST_ID_ = #{superProcessInstanceId, jdbcType=NVARCHAR}) - and RES.ID_ = (select PROC_INST_ID_ from ${prefix}ACT_RU_EXECUTION where ID_ = (select SUPER_EXEC_ from ${prefix}ACT_RU_EXECUTION where ID_ = #{subProcessInstanceId})) + and RES.ID_ = (select PROC_INST_ID_ from ${prefix}ACT_RU_EXECUTION where ID_ = (select SUPER_EXEC_ from ${prefix}ACT_RU_EXECUTION where ID_ = #{subProcessInstanceId, jdbcType=NVARCHAR})) and RES.SUPER_EXEC_ is null @@ -790,38 +790,38 @@ - and CALLBACK_ID_ = #{callbackId} + and CALLBACK_ID_ = #{callbackId, jdbcType=NVARCHAR} - and CALLBACK_TYPE_ = #{callbackType} + and CALLBACK_TYPE_ = #{callbackType, jdbcType=NVARCHAR} - and REFERENCE_ID_ = #{referenceId} + and REFERENCE_ID_ = #{referenceId, jdbcType=NVARCHAR} - and REFERENCE_TYPE_ = #{referenceType} + and REFERENCE_TYPE_ = #{referenceType, jdbcType=NVARCHAR} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) - and RES.NAME_ = #{name} + and RES.NAME_ = #{name, jdbcType=NVARCHAR} - and RES.NAME_ like #{nameLike}${wildcardEscapeClause} + and RES.NAME_ like #{nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and lower(RES.NAME_) like lower(#{nameLikeIgnoreCase})${wildcardEscapeClause} + and lower(RES.NAME_) like lower(#{nameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} and EXISTS(select 1 from ${prefix}ACT_RU_ENTITYLINK LINK where - LINK.SCOPE_ID_ = #{parentScopeId} + LINK.SCOPE_ID_ = #{parentScopeId, jdbcType=NVARCHAR} and LINK.REF_SCOPE_ID_ = RES.ID_ and LINK.HIERARCHY_TYPE_ = 'parent' ) @@ -829,25 +829,25 @@ and exists(select 1 from ${prefix}ACT_RU_ENTITYLINK LINK where LINK.REF_SCOPE_ID_ = RES.ID_ - and LINK.ROOT_SCOPE_ID_ = #{rootScopeId} + and LINK.ROOT_SCOPE_ID_ = #{rootScopeId, jdbcType=NVARCHAR} ) - and EXISTS(select ID_ from ${prefix}ACT_RU_ACTINST A where A.PROC_INST_ID_ = RES.ID_ and A.ACT_ID_ = #{activeActivityId} and A.END_TIME_ is null) + and EXISTS(select ID_ from ${prefix}ACT_RU_ACTINST A where A.PROC_INST_ID_ = RES.ID_ and A.ACT_ID_ = #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) and EXISTS(select ID_ from ${prefix}ACT_RU_ACTINST A where A.PROC_INST_ID_ = RES.ID_ and A.ACT_ID_ in - #{activeActivityId} + #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) - and EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and I.USER_ID_ = #{involvedUser}) + and EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and I.USER_ID_ = #{involvedUser, jdbcType=NVARCHAR}) and EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and - I.USER_ID_ = #{involvedUserIdentityLink.userId} and I.TYPE_ = #{involvedUserIdentityLink.type}) + I.USER_ID_ = #{involvedUserIdentityLink.userId, jdbcType=NVARCHAR} and I.TYPE_ = #{involvedUserIdentityLink.type, jdbcType=NVARCHAR}) and EXISTS( @@ -858,9 +858,9 @@ or I.GROUP_ID_ IN - - #{group} + #{groupId, jdbcType=NVARCHAR} ) @@ -868,14 +868,14 @@ and EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and - I.GROUP_ID_ = #{involvedGroupIdentityLink.groupId} and I.TYPE_ = #{involvedGroupIdentityLink.type}) + I.GROUP_ID_ = #{involvedGroupIdentityLink.groupId, jdbcType=NVARCHAR} and I.TYPE_ = #{involvedGroupIdentityLink.type, jdbcType=NVARCHAR}) and EXISTS ( - select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name} + select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = EXECUTION_ID_ @@ -886,7 +886,7 @@ and NOT EXISTS ( - select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name} + select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = EXECUTION_ID_ @@ -908,10 +908,10 @@ - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.TYPE_ = #{queryVariableValue.type} + and V.TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -926,7 +926,7 @@ LIKE - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -941,7 +941,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -949,7 +949,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -958,7 +958,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null @@ -988,8 +988,8 @@ from ${prefix}ACT_RU_EVENT_SUBSCR EVT RES.ID_ = EVT.EXECUTION_ID_ - and EVT.EVENT_TYPE_ = #{eventSubscriptionValue.eventType} - and EVT.EVENT_NAME_ = #{eventSubscriptionValue.eventName} + and EVT.EVENT_TYPE_ = #{eventSubscriptionValue.eventType, jdbcType=NVARCHAR} + and EVT.EVENT_NAME_ = #{eventSubscriptionValue.eventName, jdbcType=NVARCHAR} ) @@ -998,79 +998,79 @@ and - P.ID_ = #{orQueryObject.processDefinitionId} + P.ID_ = #{orQueryObject.processDefinitionId, jdbcType=NVARCHAR} or P.ID_ in - - #{item} + + #{processDefinitionId, jdbcType=NVARCHAR} - or P.KEY_ = #{orQueryObject.processDefinitionKey} + or P.KEY_ = #{orQueryObject.processDefinitionKey, jdbcType=NVARCHAR} or P.KEY_ in - - #{item} + + #{processDefinitionKey, jdbcType=NVARCHAR} - or P.CATEGORY_ = #{orQueryObject.processDefinitionCategory} + or P.CATEGORY_ = #{orQueryObject.processDefinitionCategory, jdbcType=NVARCHAR} - or P.NAME_ = #{orQueryObject.processDefinitionName} + or P.NAME_ = #{orQueryObject.processDefinitionName, jdbcType=NVARCHAR} - or P.VERSION_ = #{orQueryObject.processDefinitionVersion} + or P.VERSION_ = #{orQueryObject.processDefinitionVersion, jdbcType=INTEGER} - or P.ENGINE_VERSION_ = #{orQueryObject.processDefinitionEngineVersion} + or P.ENGINE_VERSION_ = #{orQueryObject.processDefinitionEngineVersion, jdbcType=NVARCHAR} - or RES.ID_ = #{orQueryObject.executionId} + or RES.ID_ = #{orQueryObject.executionId, jdbcType=NVARCHAR} - or RES.PROC_INST_ID_ = #{orQueryObject.processInstanceId} + or RES.PROC_INST_ID_ = #{orQueryObject.processInstanceId, jdbcType=NVARCHAR} or RES.PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} - or RES.BUSINESS_KEY_ = #{orQueryObject.businessKey} + or RES.BUSINESS_KEY_ = #{orQueryObject.businessKey, jdbcType=NVARCHAR} - or RES.BUSINESS_STATUS_ = #{orQueryObject.businessStatus} + or RES.BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=NVARCHAR} - or RES.BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike}${wildcardEscapeClause} + or RES.BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - or (RES.ACT_ID_ = #{orQueryObject.activityId} and RES.IS_ACTIVE_ = #{isActive}) + or (RES.ACT_ID_ = #{orQueryObject.activityId, jdbcType=NVARCHAR} and RES.IS_ACTIVE_ = #{isActive, jdbcType=BOOLEAN}) - or RES.PARENT_ID_ = #{orQueryObject.parentId} + or RES.PARENT_ID_ = #{orQueryObject.parentId, jdbcType=NVARCHAR} - or P.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId} + or P.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId, jdbcType=NVARCHAR} or P.DEPLOYMENT_ID_ IN - - #{deployment} + #{deploymentId, jdbcType=NVARCHAR} - or RES.SUPER_EXEC_ IN (select ID_ from ${prefix}ACT_RU_EXECUTION where PROC_INST_ID_ = #{orQueryObject.superProcessInstanceId}) + or RES.SUPER_EXEC_ IN (select ID_ from ${prefix}ACT_RU_EXECUTION where PROC_INST_ID_ = #{orQueryObject.superProcessInstanceId, jdbcType=NVARCHAR}) - or RES.ID_ = (select PROC_INST_ID_ from ${prefix}ACT_RU_EXECUTION where ID_ = (select SUPER_EXEC_ from ${prefix}ACT_RU_EXECUTION where ID_ = #{orQueryObject.subProcessInstanceId})) + or RES.ID_ = (select PROC_INST_ID_ from ${prefix}ACT_RU_EXECUTION where ID_ = (select SUPER_EXEC_ from ${prefix}ACT_RU_EXECUTION where ID_ = #{orQueryObject.subProcessInstanceId, jdbcType=NVARCHAR})) or RES.SUPER_EXEC_ is null @@ -1084,38 +1084,38 @@ - or CALLBACK_ID_ = #{orQueryObject.callbackId} + or CALLBACK_ID_ = #{orQueryObject.callbackId, jdbcType=NVARCHAR} - or CALLBACK_TYPE_ = #{orQueryObject.callbackType} + or CALLBACK_TYPE_ = #{orQueryObject.callbackType, jdbcType=NVARCHAR} - or REFERENCE_ID_ = #{orQueryObject.referenceId} + or REFERENCE_ID_ = #{orQueryObject.referenceId, jdbcType=NVARCHAR} - or REFERENCE_TYPE_ = #{orQueryObject.referenceType} + or REFERENCE_TYPE_ = #{orQueryObject.referenceType, jdbcType=NVARCHAR} - or RES.TENANT_ID_ = #{orQueryObject.tenantId} + or RES.TENANT_ID_ = #{orQueryObject.tenantId, jdbcType=NVARCHAR} - or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike}${wildcardEscapeClause} + or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} or (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) - or RES.NAME_ = #{orQueryObject.name} + or RES.NAME_ = #{orQueryObject.name, jdbcType=NVARCHAR} - or RES.NAME_ like #{orQueryObject.nameLike}${wildcardEscapeClause} + or RES.NAME_ like #{orQueryObject.nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - or lower(RES.NAME_) like lower(#{orQueryObject.nameLikeIgnoreCase})${wildcardEscapeClause} + or lower(RES.NAME_) like lower(#{orQueryObject.nameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} or EXISTS(select 1 from ${prefix}ACT_RU_ENTITYLINK LINK where - LINK.SCOPE_ID_ = #{orQueryObject.parentScopeId} + LINK.SCOPE_ID_ = #{orQueryObject.parentScopeId, jdbcType=NVARCHAR} and LINK.REF_SCOPE_ID_ = RES.ID_ and LINK.HIERARCHY_TYPE_ = 'parent' ) @@ -1123,25 +1123,25 @@ or exists(select 1 from ${prefix}ACT_RU_ENTITYLINK LINK where LINK.REF_SCOPE_ID_ = RES.ID_ - and LINK.ROOT_SCOPE_ID_ = #{orQueryObject.rootScopeId} + and LINK.ROOT_SCOPE_ID_ = #{orQueryObject.rootScopeId, jdbcType=NVARCHAR} ) - or EXISTS(select ID_ from ${prefix}ACT_RU_ACTINST A where A.PROC_INST_ID_ = RES.ID_ and A.ACT_ID_ = #{orQueryObject.activeActivityId} and A.END_TIME_ is null) + or EXISTS(select ID_ from ${prefix}ACT_RU_ACTINST A where A.PROC_INST_ID_ = RES.ID_ and A.ACT_ID_ = #{orQueryObject.activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) or EXISTS(select ID_ from ${prefix}ACT_RU_ACTINST A where A.PROC_INST_ID_ = RES.ID_ and A.ACT_ID_ in - #{activeActivityId} + #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) - or EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and I.USER_ID_ = #{orQueryObject.involvedUser}) + or EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and I.USER_ID_ = #{orQueryObject.involvedUser, jdbcType=NVARCHAR}) or EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and - I.USER_ID_ = #{orQueryObject.involvedUserIdentityLink.userId} and I.TYPE_ = #{orQueryObject.involvedUserIdentityLink.type}) + I.USER_ID_ = #{orQueryObject.involvedUserIdentityLink.userId, jdbcType=NVARCHAR} and I.TYPE_ = #{orQueryObject.involvedUserIdentityLink.type, jdbcType=NVARCHAR}) or EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and @@ -1151,9 +1151,9 @@ or I.GROUP_ID_ IN - - #{group} + #{groupId, jdbcType=NVARCHAR} ) @@ -1161,7 +1161,7 @@ or EXISTS(select ID_ from ${prefix}ACT_RU_IDENTITYLINK I where I.PROC_INST_ID_ = RES.ID_ and - I.GROUP_ID_ = #{orQueryObject.involvedGroupIdentityLink.groupId} and I.TYPE_ = #{orQueryObject.involvedGroupIdentityLink.type}) + I.GROUP_ID_ = #{orQueryObject.involvedGroupIdentityLink.groupId, jdbcType=NVARCHAR} and I.TYPE_ = #{orQueryObject.involvedGroupIdentityLink.type, jdbcType=NVARCHAR}) @@ -1170,7 +1170,7 @@ and EXISTS ( - select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name} + select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = EXECUTION_ID_ @@ -1181,7 +1181,7 @@ and NOT EXISTS ( - select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name} + select ID_ from ${prefix}ACT_RU_VARIABLE where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = EXECUTION_ID_ @@ -1203,10 +1203,10 @@ - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.TYPE_ = #{queryVariableValue.type} + and V.TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -1221,7 +1221,7 @@ LIKE - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -1236,7 +1236,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -1244,7 +1244,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -1253,7 +1253,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null @@ -1289,13 +1289,13 @@ ) - and RES.START_TIME_ <= #{startedBefore} + and RES.START_TIME_ <= #{startedBefore, jdbcType=TIMESTAMP} - and RES.START_TIME_ >= #{startedAfter} + and RES.START_TIME_ >= #{startedAfter, jdbcType=TIMESTAMP} - and RES.START_USER_ID_ = #{startedBy} + and RES.START_USER_ID_ = #{startedBy, jdbcType=NVARCHAR} @@ -1316,7 +1316,7 @@ - select * from ${prefix}ACT_HI_ACTINST where ACT_ID_ = #{activityId} and PROC_INST_ID_ = #{processInstanceId} + select * from ${prefix}ACT_HI_ACTINST where ACT_ID_ = #{activityId, jdbcType=NVARCHAR} and PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR} select * from ${prefix}ACT_HI_ACTINST RES - where EXECUTION_ID_ = #{parameter.executionId, jdbcType=VARCHAR} and ACT_ID_ = #{parameter.activityId, jdbcType=VARCHAR} and END_TIME_ is null + where EXECUTION_ID_ = #{parameter.executionId, jdbcType=NVARCHAR} and ACT_ID_ = #{parameter.activityId, jdbcType=NVARCHAR} and END_TIME_ is null diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricDetail.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricDetail.xml index 0a3932d8829..f8a3089bafd 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricDetail.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricDetail.xml @@ -23,15 +23,15 @@ insert into ${prefix}ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TASK_ID_, TIME_, NAME_, TEXT_) values ( - #{id, jdbcType=VARCHAR}, + #{id, jdbcType=NVARCHAR}, 'FormProperty', - #{processInstanceId, jdbcType=VARCHAR}, - #{activityInstanceId, jdbcType=VARCHAR}, - #{executionId, jdbcType=VARCHAR}, - #{taskId, jdbcType=VARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{activityInstanceId, jdbcType=NVARCHAR}, + #{executionId, jdbcType=NVARCHAR}, + #{taskId, jdbcType=NVARCHAR}, #{time, jdbcType=TIMESTAMP}, - #{propertyId, jdbcType=VARCHAR}, - #{propertyValue, jdbcType=VARCHAR} + #{propertyId, jdbcType=NVARCHAR}, + #{propertyValue, jdbcType=NVARCHAR} ) @@ -39,15 +39,15 @@ insert into ${prefix}ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TASK_ID_, TIME_, NAME_, TEXT_) values - (#{historicFormProperty.id, jdbcType=VARCHAR}, - #{historicFormProperty.detailType, jdbcType=VARCHAR}, - #{historicFormProperty.processInstanceId, jdbcType=VARCHAR}, - #{historicFormProperty.activityInstanceId, jdbcType=VARCHAR}, - #{historicFormProperty.executionId, jdbcType=VARCHAR}, - #{historicFormProperty.taskId, jdbcType=VARCHAR}, + (#{historicFormProperty.id, jdbcType=NVARCHAR}, + #{historicFormProperty.detailType, jdbcType=NVARCHAR}, + #{historicFormProperty.processInstanceId, jdbcType=NVARCHAR}, + #{historicFormProperty.activityInstanceId, jdbcType=NVARCHAR}, + #{historicFormProperty.executionId, jdbcType=NVARCHAR}, + #{historicFormProperty.taskId, jdbcType=NVARCHAR}, #{historicFormProperty.time, jdbcType=TIMESTAMP}, - #{historicFormProperty.propertyId, jdbcType=VARCHAR}, - #{historicFormProperty.propertyValue, jdbcType=VARCHAR}) + #{historicFormProperty.propertyId, jdbcType=NVARCHAR}, + #{historicFormProperty.propertyValue, jdbcType=NVARCHAR}) @@ -55,15 +55,15 @@ INSERT ALL INTO ${prefix}ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TASK_ID_, TIME_, NAME_, TEXT_) VALUES - (#{historicFormProperty.id, jdbcType=VARCHAR}, - #{historicFormProperty.detailType, jdbcType=VARCHAR}, - #{historicFormProperty.processInstanceId, jdbcType=VARCHAR}, - #{historicFormProperty.activityInstanceId, jdbcType=VARCHAR}, - #{historicFormProperty.executionId, jdbcType=VARCHAR}, - #{historicFormProperty.taskId, jdbcType=VARCHAR}, + (#{historicFormProperty.id, jdbcType=NVARCHAR}, + #{historicFormProperty.detailType, jdbcType=NVARCHAR}, + #{historicFormProperty.processInstanceId, jdbcType=NVARCHAR}, + #{historicFormProperty.activityInstanceId, jdbcType=NVARCHAR}, + #{historicFormProperty.executionId, jdbcType=NVARCHAR}, + #{historicFormProperty.taskId, jdbcType=NVARCHAR}, #{historicFormProperty.time, jdbcType=TIMESTAMP}, - #{historicFormProperty.propertyId, jdbcType=VARCHAR}, - #{historicFormProperty.propertyValue, jdbcType=VARCHAR}) + #{historicFormProperty.propertyId, jdbcType=NVARCHAR}, + #{historicFormProperty.propertyValue, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -71,21 +71,21 @@ insert into ${prefix}ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( - #{id, jdbcType=VARCHAR}, + #{id, jdbcType=NVARCHAR}, 'VariableUpdate', - #{processInstanceId, jdbcType=VARCHAR}, - #{executionId, jdbcType=VARCHAR}, - #{activityInstanceId, jdbcType=VARCHAR}, - #{taskId, jdbcType=VARCHAR}, - #{variableName, jdbcType=VARCHAR}, - #{revision, jdbcType=VARCHAR}, - #{variableType, jdbcType=VARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{executionId, jdbcType=NVARCHAR}, + #{activityInstanceId, jdbcType=NVARCHAR}, + #{taskId, jdbcType=NVARCHAR}, + #{variableName, jdbcType=NVARCHAR}, + #{revision, jdbcType=INTEGER}, + #{variableType, jdbcType=NVARCHAR}, #{time, jdbcType=TIMESTAMP}, #{byteArrayRef, typeHandler=ByteArrayRefTypeHandler}, #{doubleValue, jdbcType=DOUBLE}, #{longValue, jdbcType=BIGINT}, - #{textValue, jdbcType=VARCHAR}, - #{textValue2, jdbcType=VARCHAR} + #{textValue, jdbcType=NVARCHAR}, + #{textValue2, jdbcType=NVARCHAR} ) @@ -93,21 +93,21 @@ insert into ${prefix}ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values - (#{historicDetailVariableInstance.id, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.detailType, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.processInstanceId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.executionId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.activityInstanceId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.taskId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.variableName, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.revision, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.variableType, jdbcType=VARCHAR}, + (#{historicDetailVariableInstance.id, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.detailType, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.processInstanceId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.executionId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.activityInstanceId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.taskId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.variableName, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.revision, jdbcType=INTEGER}, + #{historicDetailVariableInstance.variableType, jdbcType=NVARCHAR}, #{historicDetailVariableInstance.time, jdbcType=TIMESTAMP}, #{historicDetailVariableInstance.byteArrayRef, typeHandler=ByteArrayRefTypeHandler}, #{historicDetailVariableInstance.doubleValue, jdbcType=DOUBLE}, #{historicDetailVariableInstance.longValue, jdbcType=BIGINT}, - #{historicDetailVariableInstance.textValue, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.textValue2, jdbcType=VARCHAR}) + #{historicDetailVariableInstance.textValue, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.textValue2, jdbcType=NVARCHAR}) @@ -116,21 +116,21 @@ INTO ${prefix}ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) VALUES - (#{historicDetailVariableInstance.id, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.detailType, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.processInstanceId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.executionId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.activityInstanceId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.taskId, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.variableName, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.revision, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.variableType, jdbcType=VARCHAR}, + (#{historicDetailVariableInstance.id, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.detailType, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.processInstanceId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.executionId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.activityInstanceId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.taskId, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.variableName, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.revision, jdbcType=INTEGER}, + #{historicDetailVariableInstance.variableType, jdbcType=NVARCHAR}, #{historicDetailVariableInstance.time, jdbcType=TIMESTAMP}, #{historicDetailVariableInstance.byteArrayRef, typeHandler=ByteArrayRefTypeHandler}, #{historicDetailVariableInstance.doubleValue, jdbcType=DOUBLE}, #{historicDetailVariableInstance.longValue, jdbcType=BIGINT}, - #{historicDetailVariableInstance.textValue, jdbcType=VARCHAR}, - #{historicDetailVariableInstance.textValue2, jdbcType=VARCHAR}) + #{historicDetailVariableInstance.textValue, jdbcType=NVARCHAR}, + #{historicDetailVariableInstance.textValue2, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -138,19 +138,19 @@ - delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id} + delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id} + delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id} + delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id} + delete from ${prefix}ACT_HI_DETAIL where ID_ = #{id, jdbcType=NVARCHAR} @@ -164,8 +164,8 @@ or HIDETAIL.PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} ) @@ -178,8 +178,8 @@ or PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} @@ -195,8 +195,8 @@ or HIDETAIL.TASK_ID_ in - - #{item} + + #{taskId, jdbcType=NVARCHAR} ) @@ -209,8 +209,8 @@ or TASK_ID_ in - - #{item} + + #{taskId, jdbcType=NVARCHAR} @@ -253,11 +253,11 @@ - - - - - + + + + + @@ -266,32 +266,32 @@ - + - - + + - - + + - - + + @@ -458,46 +458,46 @@ - and DEF.KEY_ = #{processDefinitionKey} + and DEF.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR} and DEF.KEY_ IN - - #{definition} + #{processDefinitionKey, jdbcType=NVARCHAR} - and DEF.VERSION_ = #{processDefinitionVersion} + and DEF.VERSION_ = #{processDefinitionVersion, jdbcType=INTEGER} - and DEF.CATEGORY_ = #{processDefinitionCategory} + and DEF.CATEGORY_ = #{processDefinitionCategory, jdbcType=NVARCHAR} - and DEF.NAME_ = #{processDefinitionName} + and DEF.NAME_ = #{processDefinitionName, jdbcType=NVARCHAR} - and DEF.DEPLOYMENT_ID_ = #{deploymentId} + and DEF.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=NVARCHAR} and DEF.DEPLOYMENT_ID_ IN - - #{deployment} + #{deploymentId, jdbcType=NVARCHAR} - - and DEF.KEY_ not like #{procDefKey}${wildcardEscapeClause} + + and DEF.KEY_ not like #{processDefinitionKey, jdbcType=NVARCHAR}${wildcardEscapeClause} - and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.PROC_INST_ID_ = PROC_INST_ID_) + and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = PROC_INST_ID_) - and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.PROC_INST_ID_ = PROC_INST_ID_) + and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = PROC_INST_ID_) and exists ( @@ -513,10 +513,10 @@ - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.VAR_TYPE_ = #{queryVariableValue.type} + and V.VAR_TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -531,7 +531,7 @@ LIKE - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -546,7 +546,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -554,7 +554,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -563,7 +563,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null @@ -592,39 +592,39 @@ - or DEF.KEY_ = #{orQueryObject.processDefinitionKey} + or DEF.KEY_ = #{orQueryObject.processDefinitionKey, jdbcType=NVARCHAR} or DEF.KEY_ IN - - #{definition} + #{processDefinitionKey, jdbcType=NVARCHAR} - or DEF.VERSION_ = #{orQueryObject.processDefinitionVersion} + or DEF.VERSION_ = #{orQueryObject.processDefinitionVersion, jdbcType=INTEGER} - or DEF.CATEGORY_ = #{orQueryObject.processDefinitionCategory} + or DEF.CATEGORY_ = #{orQueryObject.processDefinitionCategory, jdbcType=NVARCHAR} - or DEF.NAME_ = #{orQueryObject.processDefinitionName} + or DEF.NAME_ = #{orQueryObject.processDefinitionName, jdbcType=NVARCHAR} - or DEF.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId} + or DEF.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId, jdbcType=NVARCHAR} or DEF.DEPLOYMENT_ID_ IN - - #{deployment} + #{deploymentId, jdbcType=NVARCHAR} or - - and DEF.KEY_ not like #{procDefKey}${wildcardEscapeClause} + + and DEF.KEY_ not like #{processDefinitionKey, jdbcType=NVARCHAR}${wildcardEscapeClause} @@ -633,10 +633,10 @@ - and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.PROC_INST_ID_ = PROC_INST_ID_) + and EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = PROC_INST_ID_) - and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name} and RES.PROC_INST_ID_ = PROC_INST_ID_) + and NOT EXISTS (select ID_ from ${prefix}ACT_HI_VARINST where NAME_ = #{queryVariableValue.name, jdbcType=NVARCHAR} and RES.PROC_INST_ID_ = PROC_INST_ID_) and exists ( @@ -652,10 +652,10 @@ - and V.NAME_= #{queryVariableValue.name} + and V.NAME_= #{queryVariableValue.name, jdbcType=NVARCHAR} - and V.VAR_TYPE_ = #{queryVariableValue.type} + and V.VAR_TYPE_ = #{queryVariableValue.type, jdbcType=NVARCHAR} @@ -670,7 +670,7 @@ LIKE - #{queryVariableValue.textValue} + #{queryVariableValue.textValue, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -685,7 +685,7 @@ LIKE - #{queryVariableValue.textValue2} + #{queryVariableValue.textValue2, jdbcType=NVARCHAR} ${wildcardEscapeClause} @@ -693,7 +693,7 @@ and (V.LONG_ - #{queryVariableValue.longValue} + #{queryVariableValue.longValue, jdbcType=BIGINT} or V.LONG_ is null @@ -702,7 +702,7 @@ and (V.DOUBLE_ - #{queryVariableValue.doubleValue} + #{queryVariableValue.doubleValue, jdbcType=DOUBLE} or V.DOUBLE_ is null @@ -742,40 +742,40 @@ - ${queryTablePrefix}PROC_INST_ID_ = #{processInstanceId} + ${queryTablePrefix}PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR} and ${queryTablePrefix}PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} - and ${queryTablePrefix}PROC_DEF_ID_ = #{processDefinitionId} + and ${queryTablePrefix}PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR} - and ${queryTablePrefix}BUSINESS_KEY_ = #{businessKey} + and ${queryTablePrefix}BUSINESS_KEY_ = #{businessKey, jdbcType=NVARCHAR} - and ${queryTablePrefix}BUSINESS_KEY_ like #{businessKeyLike}${wildcardEscapeClause} + and ${queryTablePrefix}BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and ${queryTablePrefix}BUSINESS_STATUS_ = #{businessStatus} + and ${queryTablePrefix}BUSINESS_STATUS_ = #{businessStatus, jdbcType=NVARCHAR} - and ${queryTablePrefix}BUSINESS_STATUS_ like #{businessStatusLike}${wildcardEscapeClause} + and ${queryTablePrefix}BUSINESS_STATUS_ like #{businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and ${queryTablePrefix}START_TIME_ <= #{startedBefore} + and ${queryTablePrefix}START_TIME_ <= #{startedBefore, jdbcType=TIMESTAMP} - and ${queryTablePrefix}START_TIME_ >= #{startedAfter} + and ${queryTablePrefix}START_TIME_ >= #{startedAfter, jdbcType=TIMESTAMP} - and ${queryTablePrefix}END_TIME_ <= #{finishedBefore} + and ${queryTablePrefix}END_TIME_ <= #{finishedBefore, jdbcType=TIMESTAMP} - and ${queryTablePrefix}END_TIME_ >= #{finishedAfter} + and ${queryTablePrefix}END_TIME_ >= #{finishedAfter, jdbcType=TIMESTAMP} and ${queryTablePrefix}END_TIME_ IS NULL @@ -790,21 +790,21 @@ and ${queryTablePrefix}DELETE_REASON_ IS NOT NULL - and EXISTS(select ID_ from ${prefix}ACT_HI_ACTINST A where A.PROC_INST_ID_ = ${queryTablePrefix}ID_ and A.ACT_ID_ = #{activeActivityId} and A.END_TIME_ is null) + and EXISTS(select ID_ from ${prefix}ACT_HI_ACTINST A where A.PROC_INST_ID_ = ${queryTablePrefix}ID_ and A.ACT_ID_ = #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) and EXISTS(select ID_ from ${prefix}ACT_HI_ACTINST A where A.PROC_INST_ID_ = ${queryTablePrefix}ID_ and A.ACT_ID_ in - #{activeActivityId} + #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) - and (exists(select LINK.USER_ID_ from ${prefix}ACT_HI_IDENTITYLINK LINK where USER_ID_ = #{involvedUser} and LINK.PROC_INST_ID_ = ${queryTablePrefix}ID_)) + and (exists(select LINK.USER_ID_ from ${prefix}ACT_HI_IDENTITYLINK LINK where USER_ID_ = #{involvedUser, jdbcType=NVARCHAR} and LINK.PROC_INST_ID_ = ${queryTablePrefix}ID_)) and EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.PROC_INST_ID_ = ${queryTablePrefix}ID_ and - I.USER_ID_ = #{involvedUserIdentityLink.userId} and I.TYPE_ = #{involvedUserIdentityLink.type}) + I.USER_ID_ = #{involvedUserIdentityLink.userId, jdbcType=NVARCHAR} and I.TYPE_ = #{involvedUserIdentityLink.type, jdbcType=NVARCHAR}) and EXISTS( @@ -817,7 +817,7 @@ LINK.GROUP_ID_ IN - #{group} + #{group, jdbcType=NVARCHAR} ) @@ -825,53 +825,53 @@ and EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.PROC_INST_ID_ = ${queryTablePrefix}ID_ and - I.GROUP_ID_ = #{involvedGroupIdentityLink.groupId} and I.TYPE_ = #{involvedGroupIdentityLink.type}) + I.GROUP_ID_ = #{involvedGroupIdentityLink.groupId, jdbcType=NVARCHAR} and I.TYPE_ = #{involvedGroupIdentityLink.type, jdbcType=NVARCHAR}) - and ${queryTablePrefix}START_USER_ID_ = #{startedBy} + and ${queryTablePrefix}START_USER_ID_ = #{startedBy, jdbcType=NVARCHAR} - and ${queryTablePrefix}SUPER_PROCESS_INSTANCE_ID_ = #{superProcessInstanceId} + and ${queryTablePrefix}SUPER_PROCESS_INSTANCE_ID_ = #{superProcessInstanceId, jdbcType=NVARCHAR} and ${queryTablePrefix}SUPER_PROCESS_INSTANCE_ID_ is null - and ${queryTablePrefix}CALLBACK_ID_ = #{callbackId} + and ${queryTablePrefix}CALLBACK_ID_ = #{callbackId, jdbcType=NVARCHAR} - and ${queryTablePrefix}CALLBACK_TYPE_ = #{callbackType} + and ${queryTablePrefix}CALLBACK_TYPE_ = #{callbackType, jdbcType=NVARCHAR} and ${queryTablePrefix}CALLBACK_ID_ is null - and ${queryTablePrefix}REFERENCE_ID_ = #{referenceId} + and ${queryTablePrefix}REFERENCE_ID_ = #{referenceId, jdbcType=NVARCHAR} - and ${queryTablePrefix}REFERENCE_TYPE_ = #{referenceType} + and ${queryTablePrefix}REFERENCE_TYPE_ = #{referenceType, jdbcType=NVARCHAR} - and ${queryTablePrefix}TENANT_ID_ = #{tenantId} + and ${queryTablePrefix}TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and ${queryTablePrefix}TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and ${queryTablePrefix}TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (${queryTablePrefix}TENANT_ID_ = '' or ${queryTablePrefix}TENANT_ID_ is null) - and ${queryTablePrefix}NAME_ = #{name} + and ${queryTablePrefix}NAME_ = #{name, jdbcType=NVARCHAR} - and ${queryTablePrefix}NAME_ like #{nameLike}${wildcardEscapeClause} + and ${queryTablePrefix}NAME_ like #{nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and lower(${queryTablePrefix}NAME_) like lower(#{nameLikeIgnoreCase})${wildcardEscapeClause} + and lower(${queryTablePrefix}NAME_) like lower(#{nameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} and EXISTS(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where - LINK.SCOPE_ID_ = #{parentScopeId} + LINK.SCOPE_ID_ = #{parentScopeId, jdbcType=NVARCHAR} and LINK.REF_SCOPE_ID_ = RES.ID_ and LINK.HIERARCHY_TYPE_ = 'parent' ) @@ -879,47 +879,47 @@ and exists(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where LINK.REF_SCOPE_ID_ = RES.ID_ - and LINK.ROOT_SCOPE_ID_ = #{rootScopeId} + and LINK.ROOT_SCOPE_ID_ = #{rootScopeId, jdbcType=NVARCHAR} ) - ${queryTablePrefix}PROC_INST_ID_ = #{orQueryObject.processInstanceId} + ${queryTablePrefix}PROC_INST_ID_ = #{orQueryObject.processInstanceId, jdbcType=NVARCHAR} or ${queryTablePrefix}PROC_INST_ID_ in - - #{item} + + #{processInstanceId, jdbcType=NVARCHAR} - or ${queryTablePrefix}PROC_DEF_ID_ = #{orQueryObject.processDefinitionId} + or ${queryTablePrefix}PROC_DEF_ID_ = #{orQueryObject.processDefinitionId, jdbcType=NVARCHAR} - or ${queryTablePrefix}BUSINESS_KEY_ = #{orQueryObject.businessKey} + or ${queryTablePrefix}BUSINESS_KEY_ = #{orQueryObject.businessKey, jdbcType=NVARCHAR} - or ${queryTablePrefix}BUSINESS_KEY_ like #{orQueryObject.businessKeyLike}${wildcardEscapeClause} + or ${queryTablePrefix}BUSINESS_KEY_ like #{orQueryObject.businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - or ${queryTablePrefix}BUSINESS_STATUS_ = #{orQueryObject.businessStatus} + or ${queryTablePrefix}BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=NVARCHAR} - or ${queryTablePrefix}BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike}${wildcardEscapeClause} + or ${queryTablePrefix}BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - or ${queryTablePrefix}START_TIME_ <= #{orQueryObject.startedBefore} + or ${queryTablePrefix}START_TIME_ <= #{orQueryObject.startedBefore, jdbcType=TIMESTAMP} - or ${queryTablePrefix}START_TIME_ >= #{orQueryObject.startedAfter} + or ${queryTablePrefix}START_TIME_ >= #{orQueryObject.startedAfter, jdbcType=TIMESTAMP} - or (${queryTablePrefix}END_TIME_ is not NULL and ${queryTablePrefix}END_TIME_ <= #{orQueryObject.finishedBefore}) + or (${queryTablePrefix}END_TIME_ is not NULL and ${queryTablePrefix}END_TIME_ <= #{orQueryObject.finishedBefore, jdbcType=TIMESTAMP}) - or (${queryTablePrefix}END_TIME_ is not NULL and ${queryTablePrefix}END_TIME_ >= #{orQueryObject.finishedAfter}) + or (${queryTablePrefix}END_TIME_ is not NULL and ${queryTablePrefix}END_TIME_ >= #{orQueryObject.finishedAfter, jdbcType=TIMESTAMP}) or ${queryTablePrefix}END_TIME_ IS NULL @@ -934,21 +934,21 @@ or ${queryTablePrefix}DELETE_REASON_ IS NOT NULL - or EXISTS(select ID_ from ${prefix}ACT_HI_ACTINST A where A.PROC_INST_ID_ = ${queryTablePrefix}ID_ and A.ACT_ID_ = #{activeActivityId} and A.END_TIME_ is null) + or EXISTS(select ID_ from ${prefix}ACT_HI_ACTINST A where A.PROC_INST_ID_ = ${queryTablePrefix}ID_ and A.ACT_ID_ = #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) or EXISTS(select ID_ from ${prefix}ACT_HI_ACTINST A where A.PROC_INST_ID_ = ${queryTablePrefix}ID_ and A.ACT_ID_ in - #{activeActivityId} + #{activeActivityId, jdbcType=NVARCHAR} and A.END_TIME_ is null) - or (exists(select LINK.USER_ID_ from ${prefix}ACT_HI_IDENTITYLINK LINK where USER_ID_ = #{orQueryObject.involvedUser} and LINK.PROC_INST_ID_ = ${queryTablePrefix}ID_)) + or (exists(select LINK.USER_ID_ from ${prefix}ACT_HI_IDENTITYLINK LINK where USER_ID_ = #{orQueryObject.involvedUser, jdbcType=NVARCHAR} and LINK.PROC_INST_ID_ = ${queryTablePrefix}ID_)) or EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.PROC_INST_ID_ = ${queryTablePrefix}ID_ and - I.USER_ID_ = #{orQueryObject.involvedUserIdentityLink.userId} and I.TYPE_ = #{orQueryObject.involvedUserIdentityLink.type}) + I.USER_ID_ = #{orQueryObject.involvedUserIdentityLink.userId, jdbcType=NVARCHAR} and I.TYPE_ = #{orQueryObject.involvedUserIdentityLink.type, jdbcType=NVARCHAR}) or EXISTS( @@ -961,7 +961,7 @@ LINK.GROUP_ID_ IN - #{group} + #{group, jdbcType=NVARCHAR} ) @@ -969,53 +969,53 @@ or EXISTS(select ID_ from ${prefix}ACT_HI_IDENTITYLINK I where I.PROC_INST_ID_ = ${queryTablePrefix}ID_ and - I.GROUP_ID_ = #{orQueryObject.involvedGroupIdentityLink.groupId} and I.TYPE_ = #{orQueryObject.involvedGroupIdentityLink.type}) + I.GROUP_ID_ = #{orQueryObject.involvedGroupIdentityLink.groupId, jdbcType=NVARCHAR} and I.TYPE_ = #{orQueryObject.involvedGroupIdentityLink.type, jdbcType=NVARCHAR}) - or ${queryTablePrefix}START_USER_ID_ = #{orQueryObject.startedBy} + or ${queryTablePrefix}START_USER_ID_ = #{orQueryObject.startedBy, jdbcType=NVARCHAR} - or ${queryTablePrefix}SUPER_PROCESS_INSTANCE_ID_ = #{orQueryObject.superProcessInstanceId} + or ${queryTablePrefix}SUPER_PROCESS_INSTANCE_ID_ = #{orQueryObject.superProcessInstanceId, jdbcType=NVARCHAR} or ${queryTablePrefix}SUPER_PROCESS_INSTANCE_ID_ is null - or ${queryTablePrefix}CALLBACK_ID_ = #{orQueryObject.callbackId} + or ${queryTablePrefix}CALLBACK_ID_ = #{orQueryObject.callbackId, jdbcType=NVARCHAR} - or ${queryTablePrefix}CALLBACK_TYPE_ = #{orQueryObject.callbackType} + or ${queryTablePrefix}CALLBACK_TYPE_ = #{orQueryObject.callbackType, jdbcType=NVARCHAR} or ${queryTablePrefix}CALLBACK_ID_ is null - or ${queryTablePrefix}REFERENCE_ID_ = #{orQueryObject.referenceId} + or ${queryTablePrefix}REFERENCE_ID_ = #{orQueryObject.referenceId, jdbcType=NVARCHAR} - or ${queryTablePrefix}REFERENCE_TYPE_ = #{orQueryObject.referenceType} + or ${queryTablePrefix}REFERENCE_TYPE_ = #{orQueryObject.referenceType, jdbcType=NVARCHAR} - or ${queryTablePrefix}TENANT_ID_ = #{orQueryObject.tenantId} + or ${queryTablePrefix}TENANT_ID_ = #{orQueryObject.tenantId, jdbcType=NVARCHAR} - or ${queryTablePrefix}TENANT_ID_ like #{orQueryObject.tenantIdLike}${wildcardEscapeClause} + or ${queryTablePrefix}TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} or (${queryTablePrefix}TENANT_ID_ = '' or ${queryTablePrefix}TENANT_ID_ is null) - or ${queryTablePrefix}NAME_ = #{orQueryObject.name} + or ${queryTablePrefix}NAME_ = #{orQueryObject.name, jdbcType=NVARCHAR} - or ${queryTablePrefix}NAME_ like #{orQueryObject.nameLike}${wildcardEscapeClause} + or ${queryTablePrefix}NAME_ like #{orQueryObject.nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - or lower(${queryTablePrefix}NAME_) like lower(#{orQueryObject.nameLikeIgnoreCase})${wildcardEscapeClause} + or lower(${queryTablePrefix}NAME_) like lower(#{orQueryObject.nameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} or EXISTS(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where - LINK.SCOPE_ID_ = #{orQueryObject.parentScopeId} + LINK.SCOPE_ID_ = #{orQueryObject.parentScopeId, jdbcType=NVARCHAR} and LINK.REF_SCOPE_ID_ = RES.ID_ and LINK.HIERARCHY_TYPE_ = 'parent' ) @@ -1023,7 +1023,7 @@ or exists(select 1 from ${prefix}ACT_HI_ENTITYLINK LINK where LINK.REF_SCOPE_ID_ = RES.ID_ - and LINK.ROOT_SCOPE_ID_ = #{orQueryObject.rootScopeId} + and LINK.ROOT_SCOPE_ID_ = #{orQueryObject.rootScopeId, jdbcType=NVARCHAR} ) diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Model.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Model.xml index b959804ee71..2b780d756ef 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Model.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Model.xml @@ -8,36 +8,36 @@ insert into ${prefix}ACT_RE_MODEL(ID_, REV_, NAME_, KEY_, CATEGORY_, CREATE_TIME_, LAST_UPDATE_TIME_, VERSION_, META_INFO_, DEPLOYMENT_ID_, EDITOR_SOURCE_VALUE_ID_, EDITOR_SOURCE_EXTRA_VALUE_ID_, TENANT_ID_) - values(#{id, jdbcType=VARCHAR}, - 1, #{name, jdbcType=VARCHAR}, - #{key, jdbcType=VARCHAR}, - #{category, jdbcType=VARCHAR}, + values(#{id, jdbcType=NVARCHAR}, + 1, #{name, jdbcType=NVARCHAR}, + #{key, jdbcType=NVARCHAR}, + #{category, jdbcType=NVARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{lastUpdateTime, jdbcType=TIMESTAMP}, #{version, jdbcType=INTEGER}, - #{metaInfo, jdbcType=VARCHAR}, - #{deploymentId, jdbcType=VARCHAR}, - #{editorSourceValueId, jdbcType=VARCHAR}, - #{editorSourceExtraValueId, jdbcType=VARCHAR}, - #{tenantId, jdbcType=VARCHAR}) + #{metaInfo, jdbcType=NVARCHAR}, + #{deploymentId, jdbcType=NVARCHAR}, + #{editorSourceValueId, jdbcType=NVARCHAR}, + #{editorSourceExtraValueId, jdbcType=NVARCHAR}, + #{tenantId, jdbcType=NVARCHAR}) INSERT INTO ${prefix}ACT_RE_MODEL(ID_, REV_, NAME_, KEY_, CATEGORY_, CREATE_TIME_, LAST_UPDATE_TIME_, VERSION_, META_INFO_, DEPLOYMENT_ID_, EDITOR_SOURCE_VALUE_ID_, EDITOR_SOURCE_EXTRA_VALUE_ID_, TENANT_ID_) VALUES - (#{model.id, jdbcType=VARCHAR}, - 1, #{model.name, jdbcType=VARCHAR}, - #{model.key, jdbcType=VARCHAR}, - #{model.category, jdbcType=VARCHAR}, + (#{model.id, jdbcType=NVARCHAR}, + 1, #{model.name, jdbcType=NVARCHAR}, + #{model.key, jdbcType=NVARCHAR}, + #{model.category, jdbcType=NVARCHAR}, #{model.createTime, jdbcType=TIMESTAMP}, #{model.lastUpdateTime, jdbcType=TIMESTAMP}, #{model.version, jdbcType=INTEGER}, - #{model.metaInfo, jdbcType=VARCHAR}, - #{model.deploymentId, jdbcType=VARCHAR}, - #{model.editorSourceValueId, jdbcType=VARCHAR}, - #{model.editorSourceExtraValueId, jdbcType=VARCHAR}, - #{model.tenantId, jdbcType=VARCHAR}) + #{model.metaInfo, jdbcType=NVARCHAR}, + #{model.deploymentId, jdbcType=NVARCHAR}, + #{model.editorSourceValueId, jdbcType=NVARCHAR}, + #{model.editorSourceExtraValueId, jdbcType=NVARCHAR}, + #{model.tenantId, jdbcType=NVARCHAR}) @@ -46,18 +46,18 @@ INTO ${prefix}ACT_RE_MODEL(ID_, REV_, NAME_, KEY_, CATEGORY_, CREATE_TIME_, LAST_UPDATE_TIME_, VERSION_, META_INFO_, DEPLOYMENT_ID_, EDITOR_SOURCE_VALUE_ID_, EDITOR_SOURCE_EXTRA_VALUE_ID_, TENANT_ID_) VALUES - (#{model.id, jdbcType=VARCHAR}, - 1, #{model.name, jdbcType=VARCHAR}, - #{model.key, jdbcType=VARCHAR}, - #{model.category, jdbcType=VARCHAR}, + (#{model.id, jdbcType=NVARCHAR}, + 1, #{model.name, jdbcType=NVARCHAR}, + #{model.key, jdbcType=NVARCHAR}, + #{model.category, jdbcType=NVARCHAR}, #{model.createTime, jdbcType=TIMESTAMP}, #{model.lastUpdateTime, jdbcType=TIMESTAMP}, #{model.version, jdbcType=INTEGER}, - #{model.metaInfo, jdbcType=VARCHAR}, - #{model.deploymentId, jdbcType=VARCHAR}, - #{model.editorSourceValueId, jdbcType=VARCHAR}, - #{model.editorSourceExtraValueId, jdbcType=VARCHAR}, - #{model.tenantId, jdbcType=VARCHAR}) + #{model.metaInfo, jdbcType=NVARCHAR}, + #{model.deploymentId, jdbcType=NVARCHAR}, + #{model.editorSourceValueId, jdbcType=NVARCHAR}, + #{model.editorSourceExtraValueId, jdbcType=NVARCHAR}, + #{model.tenantId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -68,62 +68,62 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, - NAME_ = #{name, jdbcType=VARCHAR}, + NAME_ = #{name, jdbcType=NVARCHAR}, - KEY_ = #{key, jdbcType=VARCHAR}, + KEY_ = #{key, jdbcType=NVARCHAR}, - CATEGORY_ = #{category, jdbcType=VARCHAR}, + CATEGORY_ = #{category, jdbcType=NVARCHAR}, - LAST_UPDATE_TIME_ = #{lastUpdateTime, jdbcType=VARCHAR}, + LAST_UPDATE_TIME_ = #{lastUpdateTime, jdbcType=TIMESTAMP}, VERSION_ = #{version, jdbcType=INTEGER}, - META_INFO_ = #{metaInfo, jdbcType=VARCHAR}, + META_INFO_ = #{metaInfo, jdbcType=NVARCHAR}, - DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR}, + DEPLOYMENT_ID_ = #{deploymentId, jdbcType=NVARCHAR}, - EDITOR_SOURCE_VALUE_ID_ = #{editorSourceValueId, jdbcType=VARCHAR}, + EDITOR_SOURCE_VALUE_ID_ = #{editorSourceValueId, jdbcType=NVARCHAR}, - EDITOR_SOURCE_EXTRA_VALUE_ID_ = #{editorSourceExtraValueId, jdbcType=VARCHAR}, + EDITOR_SOURCE_EXTRA_VALUE_ID_ = #{editorSourceExtraValueId, jdbcType=NVARCHAR}, - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR}, + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR}, - where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_RE_MODEL where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_RE_MODEL where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - + - - - + + + - - - - - + + + + + @@ -145,31 +145,31 @@ from ${prefix}ACT_RE_MODEL RES - RES.ID_ = #{id} + RES.ID_ = #{id, jdbcType=NVARCHAR} - and RES.NAME_ = #{name} + and RES.NAME_ = #{name, jdbcType=NVARCHAR} - and RES.NAME_ like #{nameLike}${wildcardEscapeClause} + and RES.NAME_ like #{nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.KEY_ = #{key} + and RES.KEY_ = #{key, jdbcType=NVARCHAR} - and RES.CATEGORY_ = #{category} + and RES.CATEGORY_ = #{category, jdbcType=NVARCHAR} - and RES.CATEGORY_ like #{categoryLike}${wildcardEscapeClause} + and RES.CATEGORY_ like #{categoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and ( RES.CATEGORY_ <> #{categoryNotEquals} OR RES.CATEGORY_ is null ) + and ( RES.CATEGORY_ <> #{categoryNotEquals, jdbcType=NVARCHAR} OR RES.CATEGORY_ is null ) - and RES.VERSION_ = #{version} + and RES.VERSION_ = #{version, jdbcType=INTEGER} - and RES.DEPLOYMENT_ID_ = #{deploymentId} + and RES.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=NVARCHAR} and RES.DEPLOYMENT_ID_ is null @@ -181,10 +181,10 @@ and RES.VERSION_ = (select max(VERSION_) from ${prefix}ACT_RE_MODEL where KEY_ = RES.KEY_) - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) @@ -193,7 +193,7 @@ - select * from ${prefix}ACT_RE_PROCDEF where ID_ = #{processDefinitionId, jdbcType=VARCHAR} + select * from ${prefix}ACT_RE_PROCDEF where ID_ = #{processDefinitionId, jdbcType=NVARCHAR} select * from ${prefix}ACT_RE_PROCDEF - where DEPLOYMENT_ID_ = #{deploymentId} - and KEY_ = #{processDefinitionKey} + where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=NVARCHAR} + and KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR} and (TENANT_ID_ = '' or TENANT_ID_ is null) - select * from ${prefix}ACT_PROCDEF_INFO where ID_ = #{id} + select * from ${prefix}ACT_PROCDEF_INFO where ID_ = #{id, jdbcType=NVARCHAR} \ No newline at end of file diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Resource.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Resource.xml index 243648b83a8..2fe93f9b093 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Resource.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Resource.xml @@ -8,17 +8,17 @@ insert into ${prefix}ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) - values (#{id, jdbcType=VARCHAR}, 1, #{name, jdbcType=VARCHAR}, #{bytes, jdbcType=${blobType}}, #{deploymentId, jdbcType=VARCHAR}, #{generated, jdbcType=BOOLEAN}) + values (#{id, jdbcType=NVARCHAR}, 1, #{name, jdbcType=NVARCHAR}, #{bytes, jdbcType=${blobType}}, #{deploymentId, jdbcType=NVARCHAR}, #{generated, jdbcType=BOOLEAN}) INSERT INTO ${prefix}ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) VALUES - - (#{byteArr.id, jdbcType=VARCHAR}, - 1, #{byteArr.name, jdbcType=VARCHAR}, - #{byteArr.bytes, jdbcType=${blobType}}, - #{byteArr.deploymentId, jdbcType=VARCHAR}, - #{byteArr.generated, jdbcType=BOOLEAN}) + + (#{resource.id, jdbcType=NVARCHAR}, + 1, #{resource.name, jdbcType=NVARCHAR}, + #{resource.bytes, jdbcType=${blobType}}, + #{resource.deploymentId, jdbcType=NVARCHAR}, + #{resource.generated, jdbcType=BOOLEAN}) @@ -26,10 +26,10 @@ INSERT ALL INTO ${prefix}ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) VALUES - (#{resource.id, jdbcType=VARCHAR}, - 1, #{resource.name, jdbcType=VARCHAR}, + (#{resource.id, jdbcType=NVARCHAR}, + 1, #{resource.name, jdbcType=NVARCHAR}, #{resource.bytes, jdbcType=${blobType}}, - #{resource.deploymentId, jdbcType=VARCHAR}, + #{resource.deploymentId, jdbcType=NVARCHAR}, #{resource.generated, jdbcType=BOOLEAN}) SELECT * FROM dual @@ -38,14 +38,14 @@ - delete from ${prefix}ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = #{id} + delete from ${prefix}ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = #{id, jdbcType=NVARCHAR} - - + + @@ -53,17 +53,17 @@ @@ -71,7 +71,7 @@ BYTES_ = #{bytes, jdbcType=${blobType}}, - where ID_ = #{id, jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} \ No newline at end of file diff --git a/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/EntityLink.xml b/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/EntityLink.xml index c4ef242875a..153db89d045 100644 --- a/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/EntityLink.xml +++ b/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/EntityLink.xml @@ -9,20 +9,20 @@ insert into ${prefix}ACT_RU_ENTITYLINK (ID_, REV_, CREATE_TIME_, LINK_TYPE_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, PARENT_ELEMENT_ID_, REF_SCOPE_ID_, REF_SCOPE_TYPE_, REF_SCOPE_DEFINITION_ID_, ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, HIERARCHY_TYPE_) - values (#{id, jdbcType=VARCHAR}, + values (#{id, jdbcType=NVARCHAR}, 1, #{createTime, jdbcType=TIMESTAMP}, - #{linkType, jdbcType=VARCHAR}, - #{scopeId, jdbcType=VARCHAR}, - #{subScopeId, jdbcType=VARCHAR}, - #{scopeType, jdbcType=VARCHAR}, - #{scopeDefinitionId, jdbcType=VARCHAR}, - #{parentElementId, jdbcType=VARCHAR}, - #{referenceScopeId, jdbcType=VARCHAR}, - #{referenceScopeType, jdbcType=VARCHAR}, - #{referenceScopeDefinitionId, jdbcType=VARCHAR}, - #{rootScopeId, jdbcType=VARCHAR}, - #{rootScopeType, jdbcType=VARCHAR}, - #{hierarchyType, jdbcType=VARCHAR}) + #{linkType, jdbcType=NVARCHAR}, + #{scopeId, jdbcType=NVARCHAR}, + #{subScopeId, jdbcType=NVARCHAR}, + #{scopeType, jdbcType=NVARCHAR}, + #{scopeDefinitionId, jdbcType=NVARCHAR}, + #{parentElementId, jdbcType=NVARCHAR}, + #{referenceScopeId, jdbcType=NVARCHAR}, + #{referenceScopeType, jdbcType=NVARCHAR}, + #{referenceScopeDefinitionId, jdbcType=NVARCHAR}, + #{rootScopeId, jdbcType=NVARCHAR}, + #{rootScopeType, jdbcType=NVARCHAR}, + #{hierarchyType, jdbcType=NVARCHAR}) @@ -31,20 +31,20 @@ PARENT_ELEMENT_ID_, REF_SCOPE_ID_, REF_SCOPE_TYPE_, REF_SCOPE_DEFINITION_ID_, ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, HIERARCHY_TYPE_) values - (#{entityLink.id, jdbcType=VARCHAR}, + (#{entityLink.id, jdbcType=NVARCHAR}, 1, #{entityLink.createTime, jdbcType=TIMESTAMP}, - #{entityLink.linkType, jdbcType=VARCHAR}, - #{entityLink.scopeId, jdbcType=VARCHAR}, - #{entityLink.subScopeId, jdbcType=VARCHAR}, - #{entityLink.scopeType, jdbcType=VARCHAR}, - #{entityLink.scopeDefinitionId, jdbcType=VARCHAR}, - #{entityLink.parentElementId, jdbcType=VARCHAR}, - #{entityLink.referenceScopeId, jdbcType=VARCHAR}, - #{entityLink.referenceScopeType, jdbcType=VARCHAR}, - #{entityLink.referenceScopeDefinitionId, jdbcType=VARCHAR}, - #{entityLink.rootScopeId, jdbcType=VARCHAR}, - #{entityLink.rootScopeType, jdbcType=VARCHAR}, - #{entityLink.hierarchyType, jdbcType=VARCHAR}) + #{entityLink.linkType, jdbcType=NVARCHAR}, + #{entityLink.scopeId, jdbcType=NVARCHAR}, + #{entityLink.subScopeId, jdbcType=NVARCHAR}, + #{entityLink.scopeType, jdbcType=NVARCHAR}, + #{entityLink.scopeDefinitionId, jdbcType=NVARCHAR}, + #{entityLink.parentElementId, jdbcType=NVARCHAR}, + #{entityLink.referenceScopeId, jdbcType=NVARCHAR}, + #{entityLink.referenceScopeType, jdbcType=NVARCHAR}, + #{entityLink.referenceScopeDefinitionId, jdbcType=NVARCHAR}, + #{entityLink.rootScopeId, jdbcType=NVARCHAR}, + #{entityLink.rootScopeType, jdbcType=NVARCHAR}, + #{entityLink.hierarchyType, jdbcType=NVARCHAR}) @@ -53,20 +53,20 @@ into ${prefix}ACT_RU_ENTITYLINK (ID_, REV_, CREATE_TIME_, LINK_TYPE_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, PARENT_ELEMENT_ID_, REF_SCOPE_ID_, REF_SCOPE_TYPE_, REF_SCOPE_DEFINITION_ID_, ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, HIERARCHY_TYPE_) VALUES - (#{entityLink.id, jdbcType=VARCHAR}, + (#{entityLink.id, jdbcType=NVARCHAR}, 1, #{entityLink.createTime, jdbcType=TIMESTAMP}, - #{entityLink.linkType, jdbcType=VARCHAR}, - #{entityLink.scopeId, jdbcType=VARCHAR}, - #{entityLink.subScopeId, jdbcType=VARCHAR}, - #{entityLink.scopeType, jdbcType=VARCHAR}, - #{entityLink.scopeDefinitionId, jdbcType=VARCHAR}, - #{entityLink.parentElementId, jdbcType=VARCHAR}, - #{entityLink.referenceScopeId, jdbcType=VARCHAR}, - #{entityLink.referenceScopeType, jdbcType=VARCHAR}, - #{entityLink.referenceScopeDefinitionId, jdbcType=VARCHAR}, - #{entityLink.rootScopeId, jdbcType=VARCHAR}, - #{entityLink.rootScopeType, jdbcType=VARCHAR}, - #{entityLink.hierarchyType, jdbcType=VARCHAR}) + #{entityLink.linkType, jdbcType=NVARCHAR}, + #{entityLink.scopeId, jdbcType=NVARCHAR}, + #{entityLink.subScopeId, jdbcType=NVARCHAR}, + #{entityLink.scopeType, jdbcType=NVARCHAR}, + #{entityLink.scopeDefinitionId, jdbcType=NVARCHAR}, + #{entityLink.parentElementId, jdbcType=NVARCHAR}, + #{entityLink.referenceScopeId, jdbcType=NVARCHAR}, + #{entityLink.referenceScopeType, jdbcType=NVARCHAR}, + #{entityLink.referenceScopeDefinitionId, jdbcType=NVARCHAR}, + #{entityLink.rootScopeId, jdbcType=NVARCHAR}, + #{entityLink.rootScopeType, jdbcType=NVARCHAR}, + #{entityLink.hierarchyType, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -74,47 +74,47 @@ - delete from ${prefix}ACT_RU_ENTITYLINK where ID_ = #{id} + delete from ${prefix}ACT_RU_ENTITYLINK where ID_ = #{id, jdbcType=NVARCHAR} delete from ${prefix}ACT_RU_ENTITYLINK where - ID_ = #{entityLink.id, jdbcType=VARCHAR} + ID_ = #{entityLink.id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_ENTITYLINK where SCOPE_ID_ = #{scopeId} and SCOPE_TYPE_ = #{scopeType} + delete from ${prefix}ACT_RU_ENTITYLINK where SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_ENTITYLINK where ROOT_SCOPE_ID_ = #{rootScopeId} and ROOT_SCOPE_TYPE_ = #{rootScopeType} + delete from ${prefix}ACT_RU_ENTITYLINK where ROOT_SCOPE_ID_ = #{rootScopeId, jdbcType=NVARCHAR} and ROOT_SCOPE_TYPE_ = #{rootScopeType, jdbcType=NVARCHAR} - + - - - - - - - - - - - - + + + + + + + + + + + + @@ -141,10 +141,10 @@ inner join ( select ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_ from ${prefix}ACT_RU_ENTITYLINK - where SCOPE_ID_ = #{parameter.scopeId} and SCOPE_TYPE_ = #{parameter.scopeType} and LINK_TYPE_ = #{parameter.linkType} and ROOT_SCOPE_ID_ is not null + where SCOPE_ID_ = #{parameter.scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=NVARCHAR} and LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} and ROOT_SCOPE_ID_ is not null and ROWNUM = 1 ) ROOT_LINK ON RES.ROOT_SCOPE_ID_ = ROOT_LINK.ROOT_SCOPE_ID_ and RES.ROOT_SCOPE_TYPE_ = ROOT_LINK.ROOT_SCOPE_TYPE_ - where LINK_TYPE_ = #{parameter.linkType} + where LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} @@ -155,9 +155,9 @@ select TOP(1) ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_ from ${prefix}ACT_RU_ENTITYLINK - where SCOPE_ID_ = #{parameter.scopeId} and SCOPE_TYPE_ = #{parameter.scopeType} and LINK_TYPE_ = #{parameter.linkType} and ROOT_SCOPE_ID_ is not null + where SCOPE_ID_ = #{parameter.scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=NVARCHAR} and LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} and ROOT_SCOPE_ID_ is not null ) ROOT_LINK ON RES.ROOT_SCOPE_ID_ = ROOT_LINK.ROOT_SCOPE_ID_ and RES.ROOT_SCOPE_TYPE_ = ROOT_LINK.ROOT_SCOPE_TYPE_ - where LINK_TYPE_ = #{parameter.linkType} + where LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} diff --git a/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/HistoricEntityLink.xml b/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/HistoricEntityLink.xml index ee5335cb037..c9ab63e6cb0 100644 --- a/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/HistoricEntityLink.xml +++ b/modules/flowable-entitylink-service/src/main/resources/org/flowable/entitylink/service/db/mapping/entity/HistoricEntityLink.xml @@ -9,20 +9,20 @@ insert into ${prefix}ACT_HI_ENTITYLINK (ID_, LINK_TYPE_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, PARENT_ELEMENT_ID_, REF_SCOPE_ID_, REF_SCOPE_TYPE_, REF_SCOPE_DEFINITION_ID_, ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, CREATE_TIME_, HIERARCHY_TYPE_) - values (#{id, jdbcType=VARCHAR}, - #{linkType, jdbcType=VARCHAR}, - #{scopeId, jdbcType=VARCHAR}, - #{subScopeId, jdbcType=VARCHAR}, - #{scopeType, jdbcType=VARCHAR}, - #{scopeDefinitionId, jdbcType=VARCHAR}, - #{parentElementId, jdbcType=VARCHAR}, - #{referenceScopeId, jdbcType=VARCHAR}, - #{referenceScopeType, jdbcType=VARCHAR}, - #{referenceScopeDefinitionId, jdbcType=VARCHAR}, - #{rootScopeId, jdbcType=VARCHAR}, - #{rootScopeType, jdbcType=VARCHAR}, + values (#{id, jdbcType=NVARCHAR}, + #{linkType, jdbcType=NVARCHAR}, + #{scopeId, jdbcType=NVARCHAR}, + #{subScopeId, jdbcType=NVARCHAR}, + #{scopeType, jdbcType=NVARCHAR}, + #{scopeDefinitionId, jdbcType=NVARCHAR}, + #{parentElementId, jdbcType=NVARCHAR}, + #{referenceScopeId, jdbcType=NVARCHAR}, + #{referenceScopeType, jdbcType=NVARCHAR}, + #{referenceScopeDefinitionId, jdbcType=NVARCHAR}, + #{rootScopeId, jdbcType=NVARCHAR}, + #{rootScopeType, jdbcType=NVARCHAR}, #{createTime, jdbcType=TIMESTAMP}, - #{hierarchyType, jdbcType=VARCHAR}) + #{hierarchyType, jdbcType=NVARCHAR}) @@ -30,20 +30,20 @@ PARENT_ELEMENT_ID_, REF_SCOPE_ID_, REF_SCOPE_TYPE_, REF_SCOPE_DEFINITION_ID_, ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, CREATE_TIME_, HIERARCHY_TYPE_) values - (#{historicEntityLink.id, jdbcType=VARCHAR}, - #{historicEntityLink.linkType, jdbcType=VARCHAR}, - #{historicEntityLink.scopeId, jdbcType=VARCHAR}, - #{historicEntityLink.subScopeId, jdbcType=VARCHAR}, - #{historicEntityLink.scopeType, jdbcType=VARCHAR}, - #{historicEntityLink.scopeDefinitionId, jdbcType=VARCHAR}, - #{historicEntityLink.parentElementId, jdbcType=VARCHAR}, - #{historicEntityLink.referenceScopeId, jdbcType=VARCHAR}, - #{historicEntityLink.referenceScopeType, jdbcType=VARCHAR}, - #{historicEntityLink.referenceScopeDefinitionId, jdbcType=VARCHAR}, - #{historicEntityLink.rootScopeId, jdbcType=VARCHAR}, - #{historicEntityLink.rootScopeType, jdbcType=VARCHAR}, + (#{historicEntityLink.id, jdbcType=NVARCHAR}, + #{historicEntityLink.linkType, jdbcType=NVARCHAR}, + #{historicEntityLink.scopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.subScopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.scopeType, jdbcType=NVARCHAR}, + #{historicEntityLink.scopeDefinitionId, jdbcType=NVARCHAR}, + #{historicEntityLink.parentElementId, jdbcType=NVARCHAR}, + #{historicEntityLink.referenceScopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.referenceScopeType, jdbcType=NVARCHAR}, + #{historicEntityLink.referenceScopeDefinitionId, jdbcType=NVARCHAR}, + #{historicEntityLink.rootScopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.rootScopeType, jdbcType=NVARCHAR}, #{historicEntityLink.createTime, jdbcType=TIMESTAMP}, - #{historicEntityLink.hierarchyType, jdbcType=VARCHAR}) + #{historicEntityLink.hierarchyType, jdbcType=NVARCHAR}) @@ -52,20 +52,20 @@ INTO ${prefix}ACT_HI_ENTITYLINK (ID_, LINK_TYPE_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, PARENT_ELEMENT_ID_, REF_SCOPE_ID_, REF_SCOPE_TYPE_, REF_SCOPE_DEFINITION_ID_, ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, CREATE_TIME_, HIERARCHY_TYPE_) VALUES - (#{historicEntityLink.id, jdbcType=VARCHAR}, - #{historicEntityLink.linkType, jdbcType=VARCHAR}, - #{historicEntityLink.scopeId, jdbcType=VARCHAR}, - #{historicEntityLink.subScopeId, jdbcType=VARCHAR}, - #{historicEntityLink.scopeType, jdbcType=VARCHAR}, - #{historicEntityLink.scopeDefinitionId, jdbcType=VARCHAR}, - #{historicEntityLink.parentElementId, jdbcType=VARCHAR}, - #{historicEntityLink.referenceScopeId, jdbcType=VARCHAR}, - #{historicEntityLink.referenceScopeType, jdbcType=VARCHAR}, - #{historicEntityLink.referenceScopeDefinitionId, jdbcType=VARCHAR}, - #{historicEntityLink.rootScopeId, jdbcType=VARCHAR}, - #{historicEntityLink.rootScopeType, jdbcType=VARCHAR}, + (#{historicEntityLink.id, jdbcType=NVARCHAR}, + #{historicEntityLink.linkType, jdbcType=NVARCHAR}, + #{historicEntityLink.scopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.subScopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.scopeType, jdbcType=NVARCHAR}, + #{historicEntityLink.scopeDefinitionId, jdbcType=NVARCHAR}, + #{historicEntityLink.parentElementId, jdbcType=NVARCHAR}, + #{historicEntityLink.referenceScopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.referenceScopeType, jdbcType=NVARCHAR}, + #{historicEntityLink.referenceScopeDefinitionId, jdbcType=NVARCHAR}, + #{historicEntityLink.rootScopeId, jdbcType=NVARCHAR}, + #{historicEntityLink.rootScopeType, jdbcType=NVARCHAR}, #{historicEntityLink.createTime, jdbcType=TIMESTAMP}, - #{historicEntityLink.hierarchyType, jdbcType=VARCHAR}) + #{historicEntityLink.hierarchyType, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -73,33 +73,33 @@ - delete from ${prefix}ACT_HI_ENTITYLINK where ID_ = #{id} + delete from ${prefix}ACT_HI_ENTITYLINK where ID_ = #{id, jdbcType=NVARCHAR} delete from ${prefix}ACT_HI_ENTITYLINK where - - ID_ = #{entityLink.id, jdbcType=VARCHAR} + + ID_ = #{historicEntityLink.id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_ENTITYLINK where SCOPE_ID_ = #{scopeId} and SCOPE_TYPE_ = #{scopeType} + delete from ${prefix}ACT_HI_ENTITYLINK where SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_ENTITYLINK where SCOPE_DEFINITION_ID_ = #{scopeDefinitionId} and SCOPE_TYPE_ = #{scopeType} + delete from ${prefix}ACT_HI_ENTITYLINK where SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - delete from ${prefix}ACT_HI_ENTITYLINK where SCOPE_TYPE_ = #{scopeType} and + delete from ${prefix}ACT_HI_ENTITYLINK where SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} and ( or SCOPE_ID_ in - - #{item} + + #{scopeId, jdbcType=NVARCHAR} ) @@ -115,26 +115,26 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -161,10 +161,10 @@ inner join ( select ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_ from ${prefix}ACT_HI_ENTITYLINK - where SCOPE_ID_ = #{parameter.scopeId} and SCOPE_TYPE_ = #{parameter.scopeType} and LINK_TYPE_ = #{parameter.linkType} and ROOT_SCOPE_ID_ is not null + where SCOPE_ID_ = #{parameter.scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=NVARCHAR} and LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} and ROOT_SCOPE_ID_ is not null and ROWNUM = 1 ) ROOT_LINK ON RES.ROOT_SCOPE_ID_ = ROOT_LINK.ROOT_SCOPE_ID_ and RES.ROOT_SCOPE_TYPE_ = ROOT_LINK.ROOT_SCOPE_TYPE_ - where LINK_TYPE_ = #{parameter.linkType} + where LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} @@ -175,9 +175,9 @@ select TOP(1) ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_ from ${prefix}ACT_HI_ENTITYLINK - where SCOPE_ID_ = #{parameter.scopeId} and SCOPE_TYPE_ = #{parameter.scopeType} and LINK_TYPE_ = #{parameter.linkType} and ROOT_SCOPE_ID_ is not null + where SCOPE_ID_ = #{parameter.scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=NVARCHAR} and LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} and ROOT_SCOPE_ID_ is not null ) ROOT_LINK ON RES.ROOT_SCOPE_ID_ = ROOT_LINK.ROOT_SCOPE_ID_ and RES.ROOT_SCOPE_TYPE_ = ROOT_LINK.ROOT_SCOPE_TYPE_ - where LINK_TYPE_ = #{parameter.linkType} + where LINK_TYPE_ = #{parameter.linkType, jdbcType=NVARCHAR} diff --git a/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/mapping/entity/ChannelDefinition.xml b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/mapping/entity/ChannelDefinition.xml index 268fd330adc..d0f93a24384 100644 --- a/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/mapping/entity/ChannelDefinition.xml +++ b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/mapping/entity/ChannelDefinition.xml @@ -92,15 +92,15 @@ - delete from ${prefix}FLW_CHANNEL_DEFINITION where DEPLOYMENT_ID_ = #{deploymenId} + delete from ${prefix}FLW_CHANNEL_DEFINITION where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} - - + + @@ -115,11 +115,11 @@ select * from ${prefix}FLW_CHANNEL_DEFINITION - where DEPLOYMENT_ID_ = #{deploymentId} - and KEY_ = #{channelDefinitionKey} + where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} + and KEY_ = #{channelDefinitionKey, jdbcType=VARCHAR} and (TENANT_ID_ = '' or TENANT_ID_ is null) - select * from ${prefix}FLW_EVENT_DEFINITION where ID_ = #{eventDefinitionId, jdbcType=VARCHAR} + select * from ${prefix}FLW_EVENT_DEFINITION where ID_ = #{id, jdbcType=VARCHAR} select * from ${prefix}FLW_EVENT_DEFINITION - where DEPLOYMENT_ID_ = #{deploymentId} - and KEY_ = #{eventDefinitionKey} + where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} + and KEY_ = #{eventDefinitionKey, jdbcType=VARCHAR} and (TENANT_ID_ = '' or TENANT_ID_ is null) - select NAME_ from ${prefix}FLW_EVENT_RESOURCE where DEPLOYMENT_ID_ = #{parameter} order by NAME_ asc + select NAME_ from ${prefix}FLW_EVENT_RESOURCE where DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} order by NAME_ asc - select * from ${prefix}ACT_RU_EVENT_SUBSCR where ID_ = #{id, jdbcType=VARCHAR} + select * from ${prefix}ACT_RU_EVENT_SUBSCR where ID_ = #{id, jdbcType=NVARCHAR} select * from ${prefix}ACT_RU_EVENT_SUBSCR - where (EVENT_TYPE_ = #{parameter.eventType}) - and (SCOPE_ID_ = #{parameter.scopeId}) + where (EVENT_TYPE_ = #{parameter.eventType, jdbcType=NVARCHAR}) + and (SCOPE_ID_ = #{parameter.scopeId, jdbcType=NVARCHAR}) select * from ${prefix}ACT_RU_EVENT_SUBSCR - where (EVENT_TYPE_ = #{parameter.eventType}) - and (EVENT_NAME_ = #{parameter.eventName}) - and (EXECUTION_ID_ = #{parameter.executionId}) + where (EVENT_TYPE_ = #{parameter.eventType, jdbcType=NVARCHAR}) + and (EVENT_NAME_ = #{parameter.eventName, jdbcType=NVARCHAR}) + and (EXECUTION_ID_ = #{parameter.executionId, jdbcType=NVARCHAR}) - select * from ${prefix}ACT_HI_IDENTITYLINK where ID_ = #{id, jdbcType=VARCHAR} + select * from ${prefix}ACT_HI_IDENTITYLINK where ID_ = #{id, jdbcType=NVARCHAR} select * from ${prefix}ACT_HI_IDENTITYLINK - where TASK_ID_ = #{parameter.taskId} + where TASK_ID_ = #{parameter.taskId, jdbcType=NVARCHAR} - and USER_ID_ = #{parameter.userId} + and USER_ID_ = #{parameter.userId, jdbcType=NVARCHAR} - and GROUP_ID_ = #{parameter.groupId} + and GROUP_ID_ = #{parameter.groupId, jdbcType=NVARCHAR} - and TYPE_ = #{parameter.type} + and TYPE_ = #{parameter.type, jdbcType=NVARCHAR} diff --git a/modules/flowable-identitylink-service/src/main/resources/org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml b/modules/flowable-identitylink-service/src/main/resources/org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml index c389824371d..bfc857aade5 100644 --- a/modules/flowable-identitylink-service/src/main/resources/org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml +++ b/modules/flowable-identitylink-service/src/main/resources/org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml @@ -8,17 +8,17 @@ insert into ${prefix}ACT_RU_IDENTITYLINK (ID_, REV_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, PROC_INST_ID_, PROC_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_) - values (#{id, jdbcType=VARCHAR}, - 1, #{type, jdbcType=VARCHAR}, - #{userId, jdbcType=VARCHAR}, - #{groupId, jdbcType=VARCHAR}, - #{taskId, jdbcType=VARCHAR}, - #{processInstanceId, jdbcType=VARCHAR}, - #{processDefId, jdbcType=VARCHAR}, - #{scopeId, jdbcType=VARCHAR}, - #{subScopeId, jdbcType=VARCHAR}, - #{scopeType, jdbcType=VARCHAR}, - #{scopeDefinitionId, jdbcType=VARCHAR}) + values (#{id, jdbcType=NVARCHAR}, + 1, #{type, jdbcType=NVARCHAR}, + #{userId, jdbcType=NVARCHAR}, + #{groupId, jdbcType=NVARCHAR}, + #{taskId, jdbcType=NVARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{processDefId, jdbcType=NVARCHAR}, + #{scopeId, jdbcType=NVARCHAR}, + #{subScopeId, jdbcType=NVARCHAR}, + #{scopeType, jdbcType=NVARCHAR}, + #{scopeDefinitionId, jdbcType=NVARCHAR}) @@ -26,17 +26,17 @@ insert into ${prefix}ACT_RU_IDENTITYLINK (ID_, REV_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, PROC_INST_ID_, PROC_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_) values - (#{identityLink.id, jdbcType=VARCHAR}, - 1, #{identityLink.type, jdbcType=VARCHAR}, - #{identityLink.userId, jdbcType=VARCHAR}, - #{identityLink.groupId, jdbcType=VARCHAR}, - #{identityLink.taskId, jdbcType=VARCHAR}, - #{identityLink.processInstanceId, jdbcType=VARCHAR}, - #{identityLink.processDefId, jdbcType=VARCHAR}, - #{identityLink.scopeId, jdbcType=VARCHAR}, - #{identityLink.subScopeId, jdbcType=VARCHAR}, - #{identityLink.scopeType, jdbcType=VARCHAR}, - #{identityLink.scopeDefinitionId, jdbcType=VARCHAR}) + (#{identityLink.id, jdbcType=NVARCHAR}, + 1, #{identityLink.type, jdbcType=NVARCHAR}, + #{identityLink.userId, jdbcType=NVARCHAR}, + #{identityLink.groupId, jdbcType=NVARCHAR}, + #{identityLink.taskId, jdbcType=NVARCHAR}, + #{identityLink.processInstanceId, jdbcType=NVARCHAR}, + #{identityLink.processDefId, jdbcType=NVARCHAR}, + #{identityLink.scopeId, jdbcType=NVARCHAR}, + #{identityLink.subScopeId, jdbcType=NVARCHAR}, + #{identityLink.scopeType, jdbcType=NVARCHAR}, + #{identityLink.scopeDefinitionId, jdbcType=NVARCHAR}) @@ -44,17 +44,17 @@ INSERT ALL into ${prefix}ACT_RU_IDENTITYLINK (ID_, REV_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, PROC_INST_ID_, PROC_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_) VALUES - (#{identityLink.id, jdbcType=VARCHAR}, - 1, #{identityLink.type, jdbcType=VARCHAR}, - #{identityLink.userId, jdbcType=VARCHAR}, - #{identityLink.groupId, jdbcType=VARCHAR}, - #{identityLink.taskId, jdbcType=VARCHAR}, - #{identityLink.processInstanceId, jdbcType=VARCHAR}, - #{identityLink.processDefId, jdbcType=VARCHAR}, - #{identityLink.scopeId, jdbcType=VARCHAR}, - #{identityLink.subScopeId, jdbcType=VARCHAR}, - #{identityLink.scopeType, jdbcType=VARCHAR}, - #{identityLink.scopeDefinitionId, jdbcType=VARCHAR}) + (#{identityLink.id, jdbcType=NVARCHAR}, + 1, #{identityLink.type, jdbcType=NVARCHAR}, + #{identityLink.userId, jdbcType=NVARCHAR}, + #{identityLink.groupId, jdbcType=NVARCHAR}, + #{identityLink.taskId, jdbcType=NVARCHAR}, + #{identityLink.processInstanceId, jdbcType=NVARCHAR}, + #{identityLink.processDefId, jdbcType=NVARCHAR}, + #{identityLink.scopeId, jdbcType=NVARCHAR}, + #{identityLink.subScopeId, jdbcType=NVARCHAR}, + #{identityLink.scopeType, jdbcType=NVARCHAR}, + #{identityLink.scopeDefinitionId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -65,70 +65,70 @@ update ${prefix}ACT_RU_IDENTITYLINK - TYPE_ = #{type, jdbcType=VARCHAR}, + TYPE_ = #{type, jdbcType=NVARCHAR}, - USER_ID_ = #{userId, jdbcType=VARCHAR}, + USER_ID_ = #{userId, jdbcType=NVARCHAR}, - GROUP_ID_ = #{groupId, jdbcType=VARCHAR}, + GROUP_ID_ = #{groupId, jdbcType=NVARCHAR}, - TASK_ID_ = #{taskId, jdbcType=VARCHAR}, + TASK_ID_ = #{taskId, jdbcType=NVARCHAR}, - PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}, + PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR}, - PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}, + PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR}, - SCOPE_ID_ = #{scopeId, jdbcType=VARCHAR}, + SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR}, - SUB_SCOPE_ID_ = #{subScopeId, jdbcType=VARCHAR}, + SUB_SCOPE_ID_ = #{subScopeId, jdbcType=NVARCHAR}, - SCOPE_TYPE_ = #{scopeType, jdbcType=VARCHAR}, + SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR}, - SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=VARCHAR}, + SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=NVARCHAR}, - where ID_= #{id, jdbcType=VARCHAR} + where ID_= #{id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_IDENTITYLINK where ID_ = #{id} + delete from ${prefix}ACT_RU_IDENTITYLINK where ID_ = #{id, jdbcType=NVARCHAR} delete from ${prefix}ACT_RU_IDENTITYLINK where - ID_ = #{identityLink.id, jdbcType=VARCHAR} + ID_ = #{identityLink.id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_IDENTITYLINK where TASK_ID_ = #{id} + delete from ${prefix}ACT_RU_IDENTITYLINK where TASK_ID_ = #{taskId, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_IDENTITYLINK where PROC_DEF_ID_ = #{id} + delete from ${prefix}ACT_RU_IDENTITYLINK where PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_IDENTITYLINK where PROC_INST_ID_ = #{id} + delete from ${prefix}ACT_RU_IDENTITYLINK where PROC_INST_ID_ = #{processInstanceId, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_IDENTITYLINK where SCOPE_ID_ = #{scopeId} and SCOPE_TYPE_ = #{scopeType} + delete from ${prefix}ACT_RU_IDENTITYLINK where SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_IDENTITYLINK where SCOPE_DEFINITION_ID_ = #{scopeDefinitionId} and SCOPE_TYPE_ = #{scopeType} + delete from ${prefix}ACT_RU_IDENTITYLINK where SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=NVARCHAR} and SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} @@ -138,57 +138,57 @@ or SCOPE_ID_ in - - #{item} + + #{scopeId, jdbcType=NVARCHAR} ) - and SCOPE_TYPE_ = #{scopeType} + and SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - - - - - - - - - - - + + + + + + + + + + + select * from ${prefix}ACT_RU_IDENTITYLINK - where TASK_ID_ = #{parameter.taskId} + where TASK_ID_ = #{parameter.taskId, jdbcType=NVARCHAR} - and USER_ID_ = #{parameter.userId} + and USER_ID_ = #{parameter.userId, jdbcType=NVARCHAR} - and GROUP_ID_ = #{parameter.groupId} + and GROUP_ID_ = #{parameter.groupId, jdbcType=NVARCHAR} - and TYPE_ = #{parameter.type} + and TYPE_ = #{parameter.type, jdbcType=NVARCHAR} diff --git a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Group.xml b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Group.xml index 988c21c0891..a7e03323e46 100644 --- a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Group.xml +++ b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Group.xml @@ -9,9 +9,9 @@ insert into ${prefix}ACT_ID_GROUP (ID_, REV_, NAME_, TYPE_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{name ,jdbcType=VARCHAR}, - #{type ,jdbcType=VARCHAR} + #{id, jdbcType=NVARCHAR}, + 1, #{name, jdbcType=NVARCHAR}, + #{type, jdbcType=NVARCHAR} ) @@ -19,9 +19,9 @@ insert into ${prefix}ACT_ID_GROUP (ID_, REV_, NAME_, TYPE_) values - (#{group.id ,jdbcType=VARCHAR}, - 1, #{group.name ,jdbcType=VARCHAR}, - #{group.type ,jdbcType=VARCHAR}) + (#{group.id, jdbcType=NVARCHAR}, + 1, #{group.name, jdbcType=NVARCHAR}, + #{group.type, jdbcType=NVARCHAR}) @@ -29,9 +29,9 @@ INSERT ALL INTO ${prefix}ACT_ID_GROUP (ID_, REV_, NAME_, TYPE_) VALUES - (#{group.id ,jdbcType=VARCHAR}, - 1, #{group.name ,jdbcType=VARCHAR}, - #{group.type ,jdbcType=VARCHAR}) + (#{group.id, jdbcType=NVARCHAR}, + 1, #{group.name, jdbcType=NVARCHAR}, + #{group.type, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -41,49 +41,49 @@ update ${prefix}ACT_ID_GROUP - REV_ = #{revisionNext ,jdbcType=INTEGER}, - NAME_ = #{name ,jdbcType=VARCHAR}, - TYPE_ = #{type ,jdbcType=VARCHAR}, + REV_ = #{revisionNext, jdbcType=INTEGER}, + NAME_ = #{name, jdbcType=NVARCHAR}, + TYPE_ = #{type, jdbcType=NVARCHAR}, - where ID_ = #{id} - and REV_ = #{revision} + where ID_ = #{id, jdbcType=NVARCHAR} + and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_ID_GROUP where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_ID_GROUP where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - + - - + + @@ -104,33 +104,33 @@ from ${prefix}ACT_ID_GROUP RES - RES.ID_ = #{id} + RES.ID_ = #{id, jdbcType=NVARCHAR} and RES.ID_ IN - #{id} + #{id, jdbcType=NVARCHAR} - and RES.NAME_ = #{name} + and RES.NAME_ = #{name, jdbcType=NVARCHAR} - and RES.NAME_ like #{nameLike}${wildcardEscapeClause} + and RES.NAME_ like #{nameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and lower(RES.NAME_) like #{nameLikeIgnoreCase}${wildcardEscapeClause} + and lower(RES.NAME_) like #{nameLikeIgnoreCase, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.TYPE_ = #{type} + and RES.TYPE_ = #{type, jdbcType=NVARCHAR} - and exists(select 1 from ${prefix}ACT_ID_MEMBERSHIP M where M.GROUP_ID_ = RES.ID_ and M.USER_ID_ = #{userId}) + and exists(select 1 from ${prefix}ACT_ID_MEMBERSHIP M where M.GROUP_ID_ = RES.ID_ and M.USER_ID_ = #{userId, jdbcType=NVARCHAR}) and exists(select 1 from ${prefix}ACT_ID_MEMBERSHIP M where M.GROUP_ID_ = RES.ID_ and M.USER_ID_ in - #{userId}) + #{userId, jdbcType=NVARCHAR}) @@ -147,7 +147,7 @@ select RES.* from ${prefix}ACT_ID_GROUP RES inner join ${prefix}ACT_ID_PRIV_MAPPING MAPPING on MAPPING.GROUP_ID_ = RES.ID_ inner join ${prefix}ACT_ID_PRIV PRIV on PRIV.ID_ = MAPPING.PRIV_ID_ - where PRIV.ID_ = #{parameter} + where PRIV.ID_ = #{parameter, jdbcType=NVARCHAR} order by RES.NAME_ diff --git a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdentityInfo.xml b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdentityInfo.xml index e6d04e281c7..94b4146cc11 100644 --- a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdentityInfo.xml +++ b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdentityInfo.xml @@ -9,13 +9,13 @@ insert into ${prefix}ACT_ID_INFO (ID_, REV_, USER_ID_, TYPE_, KEY_, VALUE_, PASSWORD_, PARENT_ID_) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{userId ,jdbcType=VARCHAR}, - #{type ,jdbcType=VARCHAR}, - #{key ,jdbcType=VARCHAR}, - #{value ,jdbcType=VARCHAR}, - #{passwordBytes ,jdbcType=${blobType}}, - #{parentId ,jdbcType=VARCHAR} + #{id, jdbcType=NVARCHAR}, + 1, #{userId, jdbcType=NVARCHAR}, + #{type, jdbcType=NVARCHAR}, + #{key, jdbcType=NVARCHAR}, + #{value, jdbcType=NVARCHAR}, + #{passwordBytes, jdbcType=${blobType}}, + #{parentId, jdbcType=NVARCHAR} ) @@ -23,13 +23,13 @@ insert into ${prefix}ACT_ID_INFO (ID_, REV_, USER_ID_, TYPE_, KEY_, VALUE_, PASSWORD_, PARENT_ID_) values - (#{identityInfo.id ,jdbcType=VARCHAR}, - 1, #{identityInfo.userId ,jdbcType=VARCHAR}, - #{identityInfo.type ,jdbcType=VARCHAR}, - #{identityInfo.key ,jdbcType=VARCHAR}, - #{identityInfo.value ,jdbcType=VARCHAR}, - #{identityInfo.passwordBytes ,jdbcType=${blobType}}, - #{identityInfo.parentId ,jdbcType=VARCHAR}) + (#{identityInfo.id, jdbcType=NVARCHAR}, + 1, #{identityInfo.userId, jdbcType=NVARCHAR}, + #{identityInfo.type, jdbcType=NVARCHAR}, + #{identityInfo.key, jdbcType=NVARCHAR}, + #{identityInfo.value, jdbcType=NVARCHAR}, + #{identityInfo.passwordBytes, jdbcType=${blobType}}, + #{identityInfo.parentId, jdbcType=NVARCHAR}) @@ -37,13 +37,13 @@ INSERT ALL INTO ${prefix}ACT_ID_INFO (ID_, REV_, USER_ID_, TYPE_, KEY_, VALUE_, PASSWORD_, PARENT_ID_) VALUES - (#{identityInfo.id ,jdbcType=VARCHAR}, - 1, #{identityInfo.userId ,jdbcType=VARCHAR}, - #{identityInfo.type ,jdbcType=VARCHAR}, - #{identityInfo.key ,jdbcType=VARCHAR}, - #{identityInfo.value ,jdbcType=VARCHAR}, - #{identityInfo.passwordBytes ,jdbcType=${blobType}}, - #{identityInfo.parentId ,jdbcType=VARCHAR}) + (#{identityInfo.id, jdbcType=NVARCHAR}, + 1, #{identityInfo.userId, jdbcType=NVARCHAR}, + #{identityInfo.type, jdbcType=NVARCHAR}, + #{identityInfo.key, jdbcType=NVARCHAR}, + #{identityInfo.value, jdbcType=NVARCHAR}, + #{identityInfo.passwordBytes, jdbcType=${blobType}}, + #{identityInfo.parentId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -52,60 +52,60 @@ update ${prefix}ACT_ID_INFO - REV_ = #{revisionNext ,jdbcType=INTEGER}, - VALUE_ = #{value ,jdbcType=VARCHAR}, - PASSWORD_ = #{passwordBytes ,jdbcType=${blobType}}, + REV_ = #{revisionNext, jdbcType=INTEGER}, + VALUE_ = #{value, jdbcType=NVARCHAR}, + PASSWORD_ = #{passwordBytes, jdbcType=${blobType}}, - where ID_ = #{id} - and REV_ = #{revision} + where ID_ = #{id, jdbcType=NVARCHAR} + and REV_ = #{revision, jdbcType=INTEGER} delete from ${prefix}ACT_ID_INFO - where ID_ = #{id} and REV_ = #{revision} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - + - - - - + + + + - + \ No newline at end of file diff --git a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmByteArray.xml b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmByteArray.xml index 24e943f4a05..cd893592760 100644 --- a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmByteArray.xml +++ b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmByteArray.xml @@ -9,8 +9,8 @@ insert into ${prefix}ACT_ID_BYTEARRAY(ID_, REV_, NAME_, BYTES_) values ( - #{id, jdbcType=VARCHAR}, - 1, #{name, jdbcType=VARCHAR}, + #{id, jdbcType=NVARCHAR}, + 1, #{name, jdbcType=NVARCHAR}, #{bytes, jdbcType=${blobType}} ) @@ -19,8 +19,8 @@ insert into ${prefix}ACT_ID_BYTEARRAY(ID_, REV_, NAME_, BYTES_) values - (#{byteArray.id, jdbcType=VARCHAR}, - 1, #{byteArray.name, jdbcType=VARCHAR}, + (#{byteArray.id, jdbcType=NVARCHAR}, + 1, #{byteArray.name, jdbcType=NVARCHAR}, #{byteArray.bytes, jdbcType=${blobType}}) @@ -29,8 +29,8 @@ INSERT ALL into ${prefix}ACT_ID_BYTEARRAY(ID_, REV_, NAME_, BYTES_) VALUES - (#{byteArray.id, jdbcType=VARCHAR}, - 1, #{byteArray.name, jdbcType=VARCHAR}, + (#{byteArray.id, jdbcType=NVARCHAR}, + 1, #{byteArray.name, jdbcType=NVARCHAR}, #{byteArray.bytes, jdbcType=${blobType}}) SELECT * FROM dual @@ -44,30 +44,30 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, BYTES_ = #{bytes, jdbcType=${blobType}}, - where ID_ = #{id} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_ID_BYTEARRAY where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_ID_BYTEARRAY where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_ID_BYTEARRAY where ID_ = #{id} + delete from ${prefix}ACT_ID_BYTEARRAY where ID_ = #{id, jdbcType=NVARCHAR} - + - + @@ -78,7 +78,7 @@ diff --git a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmProperty.xml b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmProperty.xml index b387fe54f62..8d8a42f2f7e 100644 --- a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmProperty.xml +++ b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/IdmProperty.xml @@ -12,8 +12,8 @@ VALUE_, REV_ ) values ( - #{name ,jdbcType=VARCHAR}, - #{value, jdbcType=VARCHAR}, + #{name, jdbcType=NVARCHAR}, + #{value, jdbcType=NVARCHAR}, 1 ) @@ -21,8 +21,8 @@ INSERT INTO ${prefix}ACT_ID_PROPERTY (NAME_, VALUE_, REV_) VALUES - (#{property.name ,jdbcType=VARCHAR}, - #{property.value, jdbcType=VARCHAR}, + (#{property.name, jdbcType=NVARCHAR}, + #{property.value, jdbcType=NVARCHAR}, 1) @@ -31,8 +31,8 @@ INSERT ALL INTO ${prefix}ACT_ID_PROPERTY (NAME_, VALUE_, REV_) VALUES - (#{property.name ,jdbcType=VARCHAR}, - #{property.value, jdbcType=VARCHAR}, + (#{property.name, jdbcType=NVARCHAR}, + #{property.value, jdbcType=NVARCHAR}, 1) SELECT * FROM dual @@ -44,24 +44,24 @@ update ${prefix}ACT_ID_PROPERTY REV_ = #{revisionNext, jdbcType=INTEGER}, - VALUE_ = #{value, jdbcType=VARCHAR}, + VALUE_ = #{value, jdbcType=NVARCHAR}, - where NAME_ = #{name, jdbcType=VARCHAR} + where NAME_ = #{name, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_ID_PROPERTY where NAME_ = #{name} and REV_ = #{revision} + delete from ${prefix}ACT_ID_PROPERTY where NAME_ = #{name, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - - + + @@ -70,7 +70,7 @@ - select * from ${prefix}ACT_ID_PRIV where ID_ = #{id,jdbcType=VARCHAR} + select * from ${prefix}ACT_ID_PRIV where ID_ = #{id, jdbcType=NVARCHAR} - select * from ${prefix}ACT_ID_PRIV_MAPPING where ID_ = #{id,jdbcType=VARCHAR} + select * from ${prefix}ACT_ID_PRIV_MAPPING where ID_ = #{id, jdbcType=NVARCHAR} \ No newline at end of file diff --git a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Token.xml b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Token.xml index ad852832ae2..5426f46e947 100644 --- a/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Token.xml +++ b/modules/flowable-idm-engine/src/main/resources/org/flowable/idm/db/mapping/entity/Token.xml @@ -17,13 +17,13 @@ USER_ID_, TOKEN_DATA_ ) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{tokenValue, jdbcType=VARCHAR}, + #{id, jdbcType=NVARCHAR}, + 1, #{tokenValue, jdbcType=NVARCHAR}, #{tokenDate, jdbcType=TIMESTAMP}, - #{ipAddress, jdbcType=VARCHAR}, - #{userAgent, jdbcType=VARCHAR}, - #{userId, jdbcType=VARCHAR}, - #{tokenData, jdbcType=VARCHAR} + #{ipAddress, jdbcType=NVARCHAR}, + #{userAgent, jdbcType=NVARCHAR}, + #{userId, jdbcType=NVARCHAR}, + #{tokenData, jdbcType=NVARCHAR} ) @@ -40,13 +40,13 @@ ) values ( - #{token.id ,jdbcType=VARCHAR}, - 1, #{token.tokenValue, jdbcType=VARCHAR}, + #{token.id, jdbcType=NVARCHAR}, + 1, #{token.tokenValue, jdbcType=NVARCHAR}, #{token.tokenDate, jdbcType=TIMESTAMP}, - #{token.ipAddress, jdbcType=VARCHAR}, - #{token.userAgent, jdbcType=VARCHAR}, - #{token.userId, jdbcType=VARCHAR}, - #{token.tokenData, jdbcType=VARCHAR} + #{token.ipAddress, jdbcType=NVARCHAR}, + #{token.userAgent, jdbcType=NVARCHAR}, + #{token.userId, jdbcType=NVARCHAR}, + #{token.tokenData, jdbcType=NVARCHAR} ) @@ -64,13 +64,13 @@ USER_ID_, TOKEN_DATA_ ) VALUES ( - #{token.id ,jdbcType=VARCHAR}, - 1, #{token.tokenValue, jdbcType=VARCHAR}, + #{token.id, jdbcType=NVARCHAR}, + 1, #{token.tokenValue, jdbcType=NVARCHAR}, #{token.tokenDate, jdbcType=TIMESTAMP}, - #{token.ipAddress, jdbcType=VARCHAR}, - #{token.userAgent, jdbcType=VARCHAR}, - #{token.userId, jdbcType=VARCHAR}, - #{token.tokenData, jdbcType=VARCHAR} + #{token.ipAddress, jdbcType=NVARCHAR}, + #{token.userAgent, jdbcType=NVARCHAR}, + #{token.userId, jdbcType=NVARCHAR}, + #{token.tokenData, jdbcType=NVARCHAR} ) SELECT * FROM dual @@ -83,38 +83,38 @@ update ${prefix}ACT_ID_TOKEN REV_ = #{revisionNext, jdbcType=INTEGER}, - TOKEN_VALUE_ = #{tokenValue, jdbcType=VARCHAR}, + TOKEN_VALUE_ = #{tokenValue, jdbcType=NVARCHAR}, TOKEN_DATE_ = #{tokenDate, jdbcType=TIMESTAMP}, - IP_ADDRESS_ = #{ipAddress, jdbcType=VARCHAR}, - USER_AGENT_ = #{userAgent, jdbcType=VARCHAR}, - USER_ID_ = #{userId, jdbcType=VARCHAR}, - TOKEN_DATA_ = #{tokenData, jdbcType=VARCHAR}, + IP_ADDRESS_ = #{ipAddress, jdbcType=NVARCHAR}, + USER_AGENT_ = #{userAgent, jdbcType=NVARCHAR}, + USER_ID_ = #{userId, jdbcType=NVARCHAR}, + TOKEN_DATA_ = #{tokenData, jdbcType=NVARCHAR}, - where ID_ = #{id, jdbcType=VARCHAR} AND REV_ = #{revision, jdbcType=INTEGER} + where ID_ = #{id, jdbcType=NVARCHAR} AND REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_ID_TOKEN where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision} + delete from ${prefix}ACT_ID_TOKEN where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - + - + - - - - + + + + - select * from ${prefix}ACT_ID_USER where ID_ = #{id,jdbcType=VARCHAR} + select * from ${prefix}ACT_ID_USER where ID_ = #{id, jdbcType=NVARCHAR} diff --git a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/DeadLetterJob.xml b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/DeadLetterJob.xml index 55ccc930bb1..737bf39afbb 100644 --- a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/DeadLetterJob.xml +++ b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/DeadLetterJob.xml @@ -5,60 +5,60 @@ - + - - + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + - + - delete from ${prefix}ACT_RU_DEADLETTER_JOB where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_RU_DEADLETTER_JOB where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_RU_DEADLETTER_JOB where PROCESS_INSTANCE_ID_ = #{id} + delete from ${prefix}ACT_RU_DEADLETTER_JOB where PROCESS_INSTANCE_ID_ = #{processInstanceId, jdbcType=NVARCHAR} @@ -89,30 +89,30 @@ CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) - values (#{id, jdbcType=VARCHAR}, + values (#{id, jdbcType=NVARCHAR}, #{revision, jdbcType=INTEGER}, - #{category, jdbcType=VARCHAR}, - #{jobType, jdbcType=VARCHAR}, + #{category, jdbcType=NVARCHAR}, + #{jobType, jdbcType=NVARCHAR}, #{exclusive, jdbcType=BOOLEAN}, - #{executionId, jdbcType=VARCHAR}, - #{processInstanceId, jdbcType=VARCHAR}, - #{processDefinitionId, jdbcType=VARCHAR}, - #{elementId, jdbcType=VARCHAR}, - #{elementName, jdbcType=VARCHAR}, - #{scopeId, jdbcType=VARCHAR}, - #{subScopeId, jdbcType=VARCHAR}, - #{scopeType, jdbcType=VARCHAR}, - #{scopeDefinitionId, jdbcType=VARCHAR}, - #{correlationId, jdbcType=VARCHAR}, + #{executionId, jdbcType=NVARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{processDefinitionId, jdbcType=NVARCHAR}, + #{elementId, jdbcType=NVARCHAR}, + #{elementName, jdbcType=NVARCHAR}, + #{scopeId, jdbcType=NVARCHAR}, + #{subScopeId, jdbcType=NVARCHAR}, + #{scopeType, jdbcType=NVARCHAR}, + #{scopeDefinitionId, jdbcType=NVARCHAR}, + #{correlationId, jdbcType=NVARCHAR}, #{exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{exceptionMessage, jdbcType=VARCHAR}, + #{exceptionMessage, jdbcType=NVARCHAR}, #{duedate, jdbcType=TIMESTAMP}, - #{repeat, jdbcType=VARCHAR}, - #{jobHandlerType, jdbcType=VARCHAR}, - #{jobHandlerConfiguration, jdbcType=VARCHAR}, + #{repeat, jdbcType=NVARCHAR}, + #{jobHandlerType, jdbcType=NVARCHAR}, + #{jobHandlerConfiguration, jdbcType=NVARCHAR}, #{customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, #{createTime, jdbcType=TIMESTAMP}, - #{tenantId, jdbcType=VARCHAR} + #{tenantId, jdbcType=NVARCHAR} ) @@ -142,37 +142,37 @@ CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) VALUES - - (#{job.id, jdbcType=VARCHAR}, - #{job.revision, jdbcType=INTEGER}, - #{job.category, jdbcType=VARCHAR}, - #{job.jobType, jdbcType=VARCHAR}, - #{job.exclusive, jdbcType=BOOLEAN}, - #{job.executionId, jdbcType=VARCHAR}, - #{job.processInstanceId, jdbcType=VARCHAR}, - #{job.processDefinitionId, jdbcType=VARCHAR}, - #{job.elementId, jdbcType=VARCHAR}, - #{job.elementName, jdbcType=VARCHAR}, - #{job.scopeId, jdbcType=VARCHAR}, - #{job.subScopeId, jdbcType=VARCHAR}, - #{job.scopeType, jdbcType=VARCHAR}, - #{job.scopeDefinitionId, jdbcType=VARCHAR}, - #{job.correlationId, jdbcType=VARCHAR}, - #{job.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.exceptionMessage, jdbcType=VARCHAR}, - #{job.duedate, jdbcType=TIMESTAMP}, - #{job.repeat, jdbcType=VARCHAR}, - #{job.jobHandlerType, jdbcType=VARCHAR}, - #{job.jobHandlerConfiguration, jdbcType=VARCHAR}, - #{job.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.createTime, jdbcType=TIMESTAMP}, - #{job.tenantId, jdbcType=VARCHAR}) + + (#{deadLetterJob.id, jdbcType=NVARCHAR}, + #{deadLetterJob.revision, jdbcType=INTEGER}, + #{deadLetterJob.category, jdbcType=NVARCHAR}, + #{deadLetterJob.jobType, jdbcType=NVARCHAR}, + #{deadLetterJob.exclusive, jdbcType=BOOLEAN}, + #{deadLetterJob.executionId, jdbcType=NVARCHAR}, + #{deadLetterJob.processInstanceId, jdbcType=NVARCHAR}, + #{deadLetterJob.processDefinitionId, jdbcType=NVARCHAR}, + #{deadLetterJob.elementId, jdbcType=NVARCHAR}, + #{deadLetterJob.elementName, jdbcType=NVARCHAR}, + #{deadLetterJob.scopeId, jdbcType=NVARCHAR}, + #{deadLetterJob.subScopeId, jdbcType=NVARCHAR}, + #{deadLetterJob.scopeType, jdbcType=NVARCHAR}, + #{deadLetterJob.scopeDefinitionId, jdbcType=NVARCHAR}, + #{deadLetterJob.correlationId, jdbcType=NVARCHAR}, + #{deadLetterJob.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{deadLetterJob.exceptionMessage, jdbcType=NVARCHAR}, + #{deadLetterJob.duedate, jdbcType=TIMESTAMP}, + #{deadLetterJob.repeat, jdbcType=NVARCHAR}, + #{deadLetterJob.jobHandlerType, jdbcType=NVARCHAR}, + #{deadLetterJob.jobHandlerConfiguration, jdbcType=NVARCHAR}, + #{deadLetterJob.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{deadLetterJob.createTime, jdbcType=TIMESTAMP}, + #{deadLetterJob.tenantId, jdbcType=NVARCHAR}) INSERT ALL - + INTO ${prefix}ACT_RU_DEADLETTER_JOB ( ID_, REV_, @@ -198,30 +198,30 @@ CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) VALUES - (#{job.id, jdbcType=VARCHAR}, - #{job.revision, jdbcType=INTEGER}, - #{job.category, jdbcType=VARCHAR}, - #{job.jobType, jdbcType=VARCHAR}, - #{job.exclusive, jdbcType=BOOLEAN}, - #{job.executionId, jdbcType=VARCHAR}, - #{job.processInstanceId, jdbcType=VARCHAR}, - #{job.processDefinitionId, jdbcType=VARCHAR}, - #{job.elementId, jdbcType=VARCHAR}, - #{job.elementName, jdbcType=VARCHAR}, - #{job.scopeId, jdbcType=VARCHAR}, - #{job.subScopeId, jdbcType=VARCHAR}, - #{job.scopeType, jdbcType=VARCHAR}, - #{job.scopeDefinitionId, jdbcType=VARCHAR}, - #{job.correlationId, jdbcType=VARCHAR}, - #{job.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.exceptionMessage, jdbcType=VARCHAR}, - #{job.duedate, jdbcType=TIMESTAMP}, - #{job.repeat, jdbcType=VARCHAR}, - #{job.jobHandlerType, jdbcType=VARCHAR}, - #{job.jobHandlerConfiguration, jdbcType=VARCHAR}, - #{job.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.createTime, jdbcType=TIMESTAMP}, - #{job.tenantId, jdbcType=VARCHAR}) + (#{deadLetterJob.id, jdbcType=NVARCHAR}, + #{deadLetterJob.revision, jdbcType=INTEGER}, + #{deadLetterJob.category, jdbcType=NVARCHAR}, + #{deadLetterJob.jobType, jdbcType=NVARCHAR}, + #{deadLetterJob.exclusive, jdbcType=BOOLEAN}, + #{deadLetterJob.executionId, jdbcType=NVARCHAR}, + #{deadLetterJob.processInstanceId, jdbcType=NVARCHAR}, + #{deadLetterJob.processDefinitionId, jdbcType=NVARCHAR}, + #{deadLetterJob.elementId, jdbcType=NVARCHAR}, + #{deadLetterJob.elementName, jdbcType=NVARCHAR}, + #{deadLetterJob.scopeId, jdbcType=NVARCHAR}, + #{deadLetterJob.subScopeId, jdbcType=NVARCHAR}, + #{deadLetterJob.scopeType, jdbcType=NVARCHAR}, + #{deadLetterJob.scopeDefinitionId, jdbcType=NVARCHAR}, + #{deadLetterJob.correlationId, jdbcType=NVARCHAR}, + #{deadLetterJob.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{deadLetterJob.exceptionMessage, jdbcType=NVARCHAR}, + #{deadLetterJob.duedate, jdbcType=TIMESTAMP}, + #{deadLetterJob.repeat, jdbcType=NVARCHAR}, + #{deadLetterJob.jobHandlerType, jdbcType=NVARCHAR}, + #{deadLetterJob.jobHandlerConfiguration, jdbcType=NVARCHAR}, + #{deadLetterJob.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{deadLetterJob.createTime, jdbcType=TIMESTAMP}, + #{deadLetterJob.tenantId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -243,70 +243,70 @@ from ${prefix}ACT_RU_DEADLETTER_JOB RES - RES.ID_ = #{id} + RES.ID_ = #{id, jdbcType=NVARCHAR} AND RES.ID_ IN - - #{jobId} + + #{id, jdbcType=NVARCHAR} - and RES.PROCESS_INSTANCE_ID_ = #{processInstanceId} + and RES.PROCESS_INSTANCE_ID_ = #{processInstanceId, jdbcType=NVARCHAR} and RES.PROCESS_INSTANCE_ID_ IS NULL - and RES.EXECUTION_ID_ = #{executionId} + and RES.EXECUTION_ID_ = #{executionId, jdbcType=NVARCHAR} - and RES.HANDLER_TYPE_ = #{handlerType} + and RES.HANDLER_TYPE_ = #{handlerType, jdbcType=NVARCHAR} and RES.HANDLER_TYPE_ in - - #{item} + + #{handlerType, jdbcType=NVARCHAR} - and RES.PROC_DEF_ID_ = #{processDefinitionId} + and RES.PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR} - and RES.PROC_DEF_ID_ IN (select DEF.ID_ from ${prefix}ACT_RE_PROCDEF DEF where DEF.KEY_ = #{processDefinitionKey}) + and RES.PROC_DEF_ID_ IN (select DEF.ID_ from ${prefix}ACT_RE_PROCDEF DEF where DEF.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR}) - and RES.CATEGORY_ = #{category} + and RES.CATEGORY_ = #{category, jdbcType=NVARCHAR} - and RES.CATEGORY_ like #{categoryLike}${wildcardEscapeClause} + and RES.CATEGORY_ like #{categoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.ELEMENT_ID_ = #{elementId} + and RES.ELEMENT_ID_ = #{elementId, jdbcType=NVARCHAR} - and RES.ELEMENT_NAME_ = #{elementName} + and RES.ELEMENT_NAME_ = #{elementName, jdbcType=NVARCHAR} - and RES.SCOPE_ID_ = #{scopeId} + and RES.SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR} and RES.SCOPE_ID_ IS NULL - and RES.SUB_SCOPE_ID_ = #{subScopeId} + and RES.SUB_SCOPE_ID_ = #{subScopeId, jdbcType=NVARCHAR} - and RES.SCOPE_TYPE_ = #{scopeType} + and RES.SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - and RES.SCOPE_DEFINITION_ID_ = #{scopeDefinitionId} + and RES.SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=NVARCHAR} - and RES.SCOPE_DEFINITION_ID_ IN (select DEF.ID_ from ${prefix}ACT_CMMN_CASEDEF DEF where DEF.KEY_ = #{caseDefinitionKey}) + and RES.SCOPE_DEFINITION_ID_ IN (select DEF.ID_ from ${prefix}ACT_CMMN_CASEDEF DEF where DEF.KEY_ = #{caseDefinitionKey, jdbcType=VARCHAR}) - and RES.CORRELATION_ID_ = #{correlationId} + and RES.CORRELATION_ID_ = #{correlationId, jdbcType=NVARCHAR} and (RES.DUEDATE_ is null or RES.DUEDATE_ <= #{now, jdbcType=TIMESTAMP}) @@ -321,28 +321,28 @@ and RES.TYPE_ = 'externalWorker' - and RES.DUEDATE_ > #{duedateHigherThan} + and RES.DUEDATE_ > #{duedateHigherThan, jdbcType=TIMESTAMP} - and RES.DUEDATE_ < #{duedateLowerThan} + and RES.DUEDATE_ < #{duedateLowerThan, jdbcType=TIMESTAMP} - and RES.DUEDATE_ >= #{duedateHigherThanOrEqual} + and RES.DUEDATE_ >= #{duedateHigherThanOrEqual, jdbcType=TIMESTAMP} - and RES.DUEDATE_ <= #{duedateLowerThanOrEqual} + and RES.DUEDATE_ <= #{duedateLowerThanOrEqual, jdbcType=TIMESTAMP} and (RES.EXCEPTION_MSG_ is not null or RES.EXCEPTION_STACK_ID_ is not null) - and RES.EXCEPTION_MSG_ = #{exceptionMessage} + and RES.EXCEPTION_MSG_ = #{exceptionMessage, jdbcType=NVARCHAR} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) @@ -356,13 +356,13 @@ update ${prefix}ACT_RU_DEADLETTER_JOB set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( SELECT J.ID_ from ${prefix}ACT_RU_DEADLETTER_JOB J inner join ${prefix}ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) @@ -370,7 +370,7 @@ Tested this on MySQL 5.6: does NOT use a temporary table (so good performance) --> update ${prefix}ACT_RU_DEADLETTER_JOB set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( @@ -380,7 +380,7 @@ FROM ${prefix}ACT_RU_DEADLETTER_JOB J inner join ${prefix}ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) AS tempTask @@ -395,28 +395,28 @@ RETRIES_ = #{retries, jdbcType=INTEGER}, - PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}, + PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR}, - CATEGORY_ = #{category, jdbcType=VARCHAR}, + CATEGORY_ = #{category, jdbcType=NVARCHAR}, - ELEMENT_ID_ = #{elementId, jdbcType=VARCHAR}, + ELEMENT_ID_ = #{elementId, jdbcType=NVARCHAR}, - ELEMENT_NAME_ = #{elementName, jdbcType=VARCHAR}, + ELEMENT_NAME_ = #{elementName, jdbcType=NVARCHAR}, - CORRELATION_ID_ = #{correlationId, jdbcType=VARCHAR}, + CORRELATION_ID_ = #{correlationId, jdbcType=NVARCHAR}, EXCEPTION_STACK_ID_ = #{exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - EXCEPTION_MSG_ = #{exceptionMessage, jdbcType=VARCHAR}, + EXCEPTION_MSG_ = #{exceptionMessage, jdbcType=NVARCHAR}, - where ID_= #{id, jdbcType=VARCHAR} + where ID_= #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} diff --git a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/ExternalWorkerJob.xml b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/ExternalWorkerJob.xml index 5da4a88cdb8..9e5fbe413b6 100755 --- a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/ExternalWorkerJob.xml +++ b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/ExternalWorkerJob.xml @@ -7,57 +7,57 @@ - + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + - + select * from ${prefix}ACT_RU_EXTERNAL_JOB - where HANDLER_TYPE_ = #{parameter.handlerType} - and PROC_DEF_ID_ = #{parameter.processDefinitionId} + where HANDLER_TYPE_ = #{parameter.handlerType, jdbcType=NVARCHAR} + and PROC_DEF_ID_ = #{parameter.processDefinitionId, jdbcType=NVARCHAR} - select * from ${prefix}ACT_RU_HISTORY_JOB where ID_ = #{id, jdbcType=VARCHAR} + select * from ${prefix}ACT_RU_HISTORY_JOB where ID_ = #{id, jdbcType=NVARCHAR} select * from ${prefix}ACT_RU_HISTORY_JOB - where HANDLER_TYPE_ = #{parameter.handlerType} - and HANDLER_CFG_ like #{parameter.handlerConfiguration}${wildcardEscapeClause} + where HANDLER_TYPE_ = #{parameter.handlerType, jdbcType=NVARCHAR} + and HANDLER_CFG_ like #{parameter.handlerConfiguration, jdbcType=NVARCHAR}${wildcardEscapeClause} - select * from ${prefix}ACT_RU_JOB where ID_ = #{id, jdbcType=VARCHAR} + select * from ${prefix}ACT_RU_JOB where ID_ = #{id, jdbcType=NVARCHAR} select * from ${prefix}ACT_RU_JOB - where HANDLER_TYPE_ = #{parameter.handlerType} - and PROC_DEF_ID_ = #{parameter.processDefinitionId} + where HANDLER_TYPE_ = #{parameter.handlerType, jdbcType=NVARCHAR} + and PROC_DEF_ID_ = #{parameter.processDefinitionId, jdbcType=NVARCHAR} @@ -543,7 +543,7 @@ from ${prefix}ACT_RU_JOB where (RETRIES_ > 0) and (TYPE_ = 'timer') - and (EXECUTION_ID_ = #{parameter}) + and (EXECUTION_ID_ = #{parameter, jdbcType=NVARCHAR}) diff --git a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/SuspendedJob.xml b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/SuspendedJob.xml index 84a5cb40765..1a17c183af6 100644 --- a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/SuspendedJob.xml +++ b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/SuspendedJob.xml @@ -5,62 +5,62 @@ - + - - + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + - + - delete from ${prefix}ACT_RU_SUSPENDED_JOB where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_RU_SUSPENDED_JOB where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_RU_SUSPENDED_JOB where PROCESS_INSTANCE_ID_ = #{id} + delete from ${prefix}ACT_RU_SUSPENDED_JOB where PROCESS_INSTANCE_ID_ = #{processInstanceId, jdbcType=NVARCHAR} @@ -92,31 +92,31 @@ CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) - values (#{id, jdbcType=VARCHAR}, + values (#{id, jdbcType=NVARCHAR}, #{revision, jdbcType=INTEGER}, - #{category, jdbcType=VARCHAR}, - #{jobType, jdbcType=VARCHAR}, + #{category, jdbcType=NVARCHAR}, + #{jobType, jdbcType=NVARCHAR}, #{exclusive, jdbcType=BOOLEAN}, - #{executionId, jdbcType=VARCHAR}, - #{processInstanceId, jdbcType=VARCHAR}, - #{processDefinitionId, jdbcType=VARCHAR}, - #{elementId, jdbcType=VARCHAR}, - #{elementName, jdbcType=VARCHAR}, - #{scopeId, jdbcType=VARCHAR}, - #{subScopeId, jdbcType=VARCHAR}, - #{scopeType, jdbcType=VARCHAR}, - #{scopeDefinitionId, jdbcType=VARCHAR}, - #{correlationId, jdbcType=VARCHAR}, + #{executionId, jdbcType=NVARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{processDefinitionId, jdbcType=NVARCHAR}, + #{elementId, jdbcType=NVARCHAR}, + #{elementName, jdbcType=NVARCHAR}, + #{scopeId, jdbcType=NVARCHAR}, + #{subScopeId, jdbcType=NVARCHAR}, + #{scopeType, jdbcType=NVARCHAR}, + #{scopeDefinitionId, jdbcType=NVARCHAR}, + #{correlationId, jdbcType=NVARCHAR}, #{retries, jdbcType=INTEGER}, #{exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{exceptionMessage, jdbcType=VARCHAR}, + #{exceptionMessage, jdbcType=NVARCHAR}, #{duedate, jdbcType=TIMESTAMP}, - #{repeat, jdbcType=VARCHAR}, - #{jobHandlerType, jdbcType=VARCHAR}, - #{jobHandlerConfiguration, jdbcType=VARCHAR}, + #{repeat, jdbcType=NVARCHAR}, + #{jobHandlerType, jdbcType=NVARCHAR}, + #{jobHandlerConfiguration, jdbcType=NVARCHAR}, #{customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, #{createTime, jdbcType=TIMESTAMP}, - #{tenantId, jdbcType=VARCHAR} + #{tenantId, jdbcType=NVARCHAR} ) @@ -147,38 +147,38 @@ CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) VALUES - - (#{job.id, jdbcType=VARCHAR}, - #{job.revision, jdbcType=INTEGER}, - #{job.category, jdbcType=VARCHAR}, - #{job.jobType, jdbcType=VARCHAR}, - #{job.exclusive, jdbcType=BOOLEAN}, - #{job.executionId, jdbcType=VARCHAR}, - #{job.processInstanceId, jdbcType=VARCHAR}, - #{job.processDefinitionId, jdbcType=VARCHAR}, - #{job.elementId, jdbcType=VARCHAR}, - #{job.elementName, jdbcType=VARCHAR}, - #{job.scopeId, jdbcType=VARCHAR}, - #{job.subScopeId, jdbcType=VARCHAR}, - #{job.scopeType, jdbcType=VARCHAR}, - #{job.scopeDefinitionId, jdbcType=VARCHAR}, - #{job.correlationId, jdbcType=VARCHAR}, - #{job.retries, jdbcType=INTEGER}, - #{job.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.exceptionMessage, jdbcType=VARCHAR}, - #{job.duedate, jdbcType=TIMESTAMP}, - #{job.repeat, jdbcType=VARCHAR}, - #{job.jobHandlerType, jdbcType=VARCHAR}, - #{job.jobHandlerConfiguration, jdbcType=VARCHAR}, - #{job.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.createTime, jdbcType=TIMESTAMP}, - #{job.tenantId, jdbcType=VARCHAR}) + + (#{suspendedJob.id, jdbcType=NVARCHAR}, + #{suspendedJob.revision, jdbcType=INTEGER}, + #{suspendedJob.category, jdbcType=NVARCHAR}, + #{suspendedJob.jobType, jdbcType=NVARCHAR}, + #{suspendedJob.exclusive, jdbcType=BOOLEAN}, + #{suspendedJob.executionId, jdbcType=NVARCHAR}, + #{suspendedJob.processInstanceId, jdbcType=NVARCHAR}, + #{suspendedJob.processDefinitionId, jdbcType=NVARCHAR}, + #{suspendedJob.elementId, jdbcType=NVARCHAR}, + #{suspendedJob.elementName, jdbcType=NVARCHAR}, + #{suspendedJob.scopeId, jdbcType=NVARCHAR}, + #{suspendedJob.subScopeId, jdbcType=NVARCHAR}, + #{suspendedJob.scopeType, jdbcType=NVARCHAR}, + #{suspendedJob.scopeDefinitionId, jdbcType=NVARCHAR}, + #{suspendedJob.correlationId, jdbcType=NVARCHAR}, + #{suspendedJob.retries, jdbcType=INTEGER}, + #{suspendedJob.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{suspendedJob.exceptionMessage, jdbcType=NVARCHAR}, + #{suspendedJob.duedate, jdbcType=TIMESTAMP}, + #{suspendedJob.repeat, jdbcType=NVARCHAR}, + #{suspendedJob.jobHandlerType, jdbcType=NVARCHAR}, + #{suspendedJob.jobHandlerConfiguration, jdbcType=NVARCHAR}, + #{suspendedJob.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{suspendedJob.createTime, jdbcType=TIMESTAMP}, + #{suspendedJob.tenantId, jdbcType=NVARCHAR}) INSERT ALL - + INTO ${prefix}ACT_RU_SUSPENDED_JOB ( ID_, REV_, @@ -205,31 +205,31 @@ CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) VALUES - (#{job.id, jdbcType=VARCHAR}, - #{job.revision, jdbcType=INTEGER}, - #{job.category, jdbcType=VARCHAR}, - #{job.jobType, jdbcType=VARCHAR}, - #{job.exclusive, jdbcType=BOOLEAN}, - #{job.executionId, jdbcType=VARCHAR}, - #{job.processInstanceId, jdbcType=VARCHAR}, - #{job.processDefinitionId, jdbcType=VARCHAR}, - #{job.elementId, jdbcType=VARCHAR}, - #{job.elementName, jdbcType=VARCHAR}, - #{job.scopeId, jdbcType=VARCHAR}, - #{job.subScopeId, jdbcType=VARCHAR}, - #{job.scopeType, jdbcType=VARCHAR}, - #{job.scopeDefinitionId, jdbcType=VARCHAR}, - #{job.correlationId, jdbcType=VARCHAR}, - #{job.retries, jdbcType=INTEGER}, - #{job.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.exceptionMessage, jdbcType=VARCHAR}, - #{job.duedate, jdbcType=TIMESTAMP}, - #{job.repeat, jdbcType=VARCHAR}, - #{job.jobHandlerType, jdbcType=VARCHAR}, - #{job.jobHandlerConfiguration, jdbcType=VARCHAR}, - #{job.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - #{job.createTime, jdbcType=TIMESTAMP}, - #{job.tenantId, jdbcType=VARCHAR}) + (#{suspendedJob.id, jdbcType=NVARCHAR}, + #{suspendedJob.revision, jdbcType=INTEGER}, + #{suspendedJob.category, jdbcType=NVARCHAR}, + #{suspendedJob.jobType, jdbcType=NVARCHAR}, + #{suspendedJob.exclusive, jdbcType=BOOLEAN}, + #{suspendedJob.executionId, jdbcType=NVARCHAR}, + #{suspendedJob.processInstanceId, jdbcType=NVARCHAR}, + #{suspendedJob.processDefinitionId, jdbcType=NVARCHAR}, + #{suspendedJob.elementId, jdbcType=NVARCHAR}, + #{suspendedJob.elementName, jdbcType=NVARCHAR}, + #{suspendedJob.scopeId, jdbcType=NVARCHAR}, + #{suspendedJob.subScopeId, jdbcType=NVARCHAR}, + #{suspendedJob.scopeType, jdbcType=NVARCHAR}, + #{suspendedJob.scopeDefinitionId, jdbcType=NVARCHAR}, + #{suspendedJob.correlationId, jdbcType=NVARCHAR}, + #{suspendedJob.retries, jdbcType=INTEGER}, + #{suspendedJob.exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{suspendedJob.exceptionMessage, jdbcType=NVARCHAR}, + #{suspendedJob.duedate, jdbcType=TIMESTAMP}, + #{suspendedJob.repeat, jdbcType=NVARCHAR}, + #{suspendedJob.jobHandlerType, jdbcType=NVARCHAR}, + #{suspendedJob.jobHandlerConfiguration, jdbcType=NVARCHAR}, + #{suspendedJob.customValuesByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, + #{suspendedJob.createTime, jdbcType=TIMESTAMP}, + #{suspendedJob.tenantId, jdbcType=NVARCHAR}) SELECT * FROM dual @@ -251,70 +251,70 @@ from ${prefix}ACT_RU_SUSPENDED_JOB RES - RES.ID_ = #{id} + RES.ID_ = #{id, jdbcType=NVARCHAR} AND RES.ID_ IN - - #{jobId} + + #{id, jdbcType=NVARCHAR} - and RES.PROCESS_INSTANCE_ID_ = #{processInstanceId} + and RES.PROCESS_INSTANCE_ID_ = #{processInstanceId, jdbcType=NVARCHAR} and RES.PROCESS_INSTANCE_ID_ IS NULL - and RES.EXECUTION_ID_ = #{executionId} + and RES.EXECUTION_ID_ = #{executionId, jdbcType=NVARCHAR} - and RES.HANDLER_TYPE_ = #{handlerType} + and RES.HANDLER_TYPE_ = #{handlerType, jdbcType=NVARCHAR} and RES.HANDLER_TYPE_ in - - #{item} + + #{handlerType, jdbcType=NVARCHAR} - and RES.PROC_DEF_ID_ = #{processDefinitionId} + and RES.PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR} - and RES.PROC_DEF_ID_ IN (select DEF.ID_ from ${prefix}ACT_RE_PROCDEF DEF where DEF.KEY_ = #{processDefinitionKey}) + and RES.PROC_DEF_ID_ IN (select DEF.ID_ from ${prefix}ACT_RE_PROCDEF DEF where DEF.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR}) - and RES.CATEGORY_ = #{category} + and RES.CATEGORY_ = #{category, jdbcType=NVARCHAR} - and RES.CATEGORY_ like #{categoryLike}${wildcardEscapeClause} + and RES.CATEGORY_ like #{categoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} - and RES.ELEMENT_ID_ = #{elementId} + and RES.ELEMENT_ID_ = #{elementId, jdbcType=NVARCHAR} - and RES.ELEMENT_NAME_ = #{elementName} + and RES.ELEMENT_NAME_ = #{elementName, jdbcType=NVARCHAR} - and RES.SCOPE_ID_ = #{scopeId} + and RES.SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR} and RES.SCOPE_ID_ IS NULL - and RES.SUB_SCOPE_ID_ = #{subScopeId} + and RES.SUB_SCOPE_ID_ = #{subScopeId, jdbcType=NVARCHAR} - and RES.SCOPE_TYPE_ = #{scopeType} + and RES.SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR} - and RES.SCOPE_DEFINITION_ID_ = #{scopeDefinitionId} + and RES.SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=NVARCHAR} - and RES.SCOPE_DEFINITION_ID_ IN (select DEF.ID_ from ${prefix}ACT_CMMN_CASEDEF DEF where DEF.KEY_ = #{caseDefinitionKey}) + and RES.SCOPE_DEFINITION_ID_ IN (select DEF.ID_ from ${prefix}ACT_CMMN_CASEDEF DEF where DEF.KEY_ = #{caseDefinitionKey, jdbcType=VARCHAR}) - and RES.CORRELATION_ID_ = #{correlationId} + and RES.CORRELATION_ID_ = #{correlationId, jdbcType=NVARCHAR} and RES.RETRIES_ > 0 @@ -332,28 +332,28 @@ and RES.TYPE_ = 'externalWorker' - and RES.DUEDATE_ > #{duedateHigherThan} + and RES.DUEDATE_ > #{duedateHigherThan, jdbcType=TIMESTAMP} - and RES.DUEDATE_ < #{duedateLowerThan} + and RES.DUEDATE_ < #{duedateLowerThan, jdbcType=TIMESTAMP} - and RES.DUEDATE_ >= #{duedateHigherThanOrEqual} + and RES.DUEDATE_ >= #{duedateHigherThanOrEqual, jdbcType=TIMESTAMP} - and RES.DUEDATE_ <= #{duedateLowerThanOrEqual} + and RES.DUEDATE_ <= #{duedateLowerThanOrEqual, jdbcType=TIMESTAMP} and (RES.EXCEPTION_MSG_ is not null or RES.EXCEPTION_STACK_ID_ is not null) - and RES.EXCEPTION_MSG_ = #{exceptionMessage} + and RES.EXCEPTION_MSG_ = #{exceptionMessage, jdbcType=NVARCHAR} - and RES.TENANT_ID_ = #{tenantId} + and RES.TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} - and RES.TENANT_ID_ like #{tenantIdLike}${wildcardEscapeClause} + and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) @@ -367,14 +367,14 @@ update ${prefix}ACT_RU_SUSPENDED_JOB set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( SELECT J.ID_ from ${prefix}ACT_RU_SUSPENDED_JOB J inner join ${prefix}ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) @@ -383,7 +383,7 @@ update ${prefix}ACT_RU_SUSPENDED_JOB set TENANT_ID_ = - #{tenantId, jdbcType=VARCHAR} + #{tenantId, jdbcType=NVARCHAR} where ID_ in ( SELECT tempTask.tempId @@ -392,7 +392,7 @@ FROM ${prefix}ACT_RU_SUSPENDED_JOB J inner join ${prefix}ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR}) AS tempTask + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR}) AS tempTask ) @@ -404,28 +404,28 @@ RETRIES_ = #{retries, jdbcType=INTEGER}, - PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}, + PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR}, - CATEGORY_ = #{category, jdbcType=VARCHAR}, + CATEGORY_ = #{category, jdbcType=NVARCHAR}, - ELEMENT_ID_ = #{elementId, jdbcType=VARCHAR}, + ELEMENT_ID_ = #{elementId, jdbcType=NVARCHAR}, - ELEMENT_NAME_ = #{elementName, jdbcType=VARCHAR}, + ELEMENT_NAME_ = #{elementName, jdbcType=NVARCHAR}, - CORRELATION_ID_ = #{correlationId, jdbcType=VARCHAR}, + CORRELATION_ID_ = #{correlationId, jdbcType=NVARCHAR}, EXCEPTION_STACK_ID_ = #{exceptionByteArrayRef, typeHandler=JobByteArrayRefTypeHandler}, - EXCEPTION_MSG_ = #{exceptionMessage, jdbcType=VARCHAR}, + EXCEPTION_MSG_ = #{exceptionMessage, jdbcType=NVARCHAR}, - where ID_= #{id, jdbcType=VARCHAR} + where ID_= #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} diff --git a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/TimerJob.xml b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/TimerJob.xml index 33d4a67dac2..4c8e3971cb5 100644 --- a/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/TimerJob.xml +++ b/modules/flowable-job-service/src/main/resources/org/flowable/job/service/db/mapping/entity/TimerJob.xml @@ -7,45 +7,45 @@ - + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + - + select J.* from ${prefix}ACT_RU_TIMER_JOB J - where J.HANDLER_TYPE_ = #{parameter.handlerType} - and J.PROC_DEF_ID_ = #{parameter.processDefinitionId} + where J.HANDLER_TYPE_ = #{parameter.handlerType, jdbcType=NVARCHAR} + and J.PROC_DEF_ID_ = #{parameter.processDefinitionId, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_TIMER_JOB where ID_ = #{id} and REV_ = #{revision} + delete from ${prefix}ACT_RU_TIMER_JOB where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} delete from ${prefix}ACT_RU_TIMER_JOB where ID_ in - #{timerJob.id} + #{timerJob.id, jdbcType=NVARCHAR} - delete from ${prefix}ACT_RU_TIMER_JOB where PROCESS_INSTANCE_ID_ = #{id} + delete from ${prefix}ACT_RU_TIMER_JOB where PROCESS_INSTANCE_ID_ = #{id, jdbcType=NVARCHAR} update ${prefix}ACT_RU_TIMER_JOB set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( SELECT J.ID_ from ${prefix}ACT_RU_TIMER_JOB J inner join ${prefix}ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) - update ${prefix}ACT_RU_TIMER_JOB set LOCK_OWNER_ = #{lockOwner, jdbcType=VARCHAR}, LOCK_EXP_TIME_ = #{lockExpirationTime, jdbcType=TIMESTAMP} + update ${prefix}ACT_RU_TIMER_JOB set LOCK_OWNER_ = #{lockOwner, jdbcType=NVARCHAR}, LOCK_EXP_TIME_ = #{lockExpirationTime, jdbcType=TIMESTAMP} where ID_ in - #{timerJob.id} + #{timerJob.id, jdbcType=NVARCHAR} @@ -522,7 +522,7 @@ table (so good, performance) --> update ${prefix}ACT_RU_TIMER_JOB set - TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + TENANT_ID_ = #{tenantId, jdbcType=NVARCHAR} where ID_ in ( @@ -532,7 +532,7 @@ FROM ${prefix}ACT_RU_TIMER_JOB J inner join ${prefix}ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_ inner join ${prefix}ACT_RE_DEPLOYMENT D on P.DEPLOYMENT_ID_ = D.ID_ - where D.ID_ = #{deploymentId, jdbcType=VARCHAR} + where D.ID_ = #{deploymentId, jdbcType=NVARCHAR} ) AS tempTask ) @@ -540,7 +540,7 @@ update ${prefix}ACT_RU_TIMER_JOB set LOCK_OWNER_ = null, LOCK_EXP_TIME_ = null, CREATE_TIME_ = #{now, jdbcType=TIMESTAMP} - where ID_ = #{id,jdbcType=VARCHAR} + where ID_ = #{id, jdbcType=NVARCHAR} diff --git a/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/test/java/org/flowable/db/EngineMappingsValidationTest.java b/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/test/java/org/flowable/db/EngineMappingsValidationTest.java index 9872a168763..08bd82fe388 100644 --- a/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/test/java/org/flowable/db/EngineMappingsValidationTest.java +++ b/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/test/java/org/flowable/db/EngineMappingsValidationTest.java @@ -13,14 +13,19 @@ package org.flowable.db; import static org.assertj.core.api.Assertions.assertThat; +import static org.flowable.db.EntityParameterTypesOverview.getColumnType; +import static org.flowable.db.EntityParameterTypesOverview.getParameterType; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.io.StringReader; import java.lang.reflect.Modifier; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -39,6 +44,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.flowable.common.engine.api.FlowableException; import org.flowable.common.engine.impl.persistence.entity.Entity; @@ -239,6 +245,119 @@ public void verifyUpdateStatements(EntityMappingPackageInformation packageInform } } + @ParameterizedTest(name = "Package {0}") + @ArgumentsSource(PackageArgumentsProvider.class) + public void verifyAllParametersAreTyped(EntityMappingPackageInformation packageInformation) throws IOException { + Map mappedResources = readMappingFileAsString(packageInformation); + assertFalse(mappedResources.isEmpty()); + + for (String mappedResource : mappedResources.keySet()) { + System.out.println("Checking mapping " + mappedResource); + String xmlContent = mappedResources.get(mappedResource); + + int lineCounter = 0; + try (BufferedReader reader = new BufferedReader(new StringReader(xmlContent))) { + String line; + while ((line = reader.readLine()) != null) { + + lineCounter++; + + // Checking the string replacements (they are passed by ${} ) + if (line.contains("${")) { + + int index = -1; + while ((index = line.indexOf("${", index + 1)) > 0) { + int endIndex = line.indexOf("}", index); + assertThat(endIndex).isGreaterThan(0); + String content = line.substring(index + 2, endIndex); + + assertThat(content).isIn("prefix", "queryTablePrefix", "queryTablePrefixSelect", + "limitBefore", "limitBetween", "limitAfter", + "blobType", "orderBy", "outerJoinOrderBy", "wildcardEscapeClause", "sql"); + } + + } + + // ResultMap validation + if (line.contains(" 0) { + int endIndex = line.indexOf("}", index); + String content = line.substring(index + 2, endIndex); + + if (!content.contains("typeHandler")) { // only checking jdbcTypes, not the typeHandler + assertThat(content) + .withFailMessage("Missing 'jdbcType' in " + mappedResource + + " on line " + lineCounter + ": #{" + content + "}" + " for resource " + mappedResource) + .contains(", jdbcType="); + + int commaIndex = line.indexOf(",", index); + String parameterName = line.substring(index + 2, commaIndex).trim(); + + int equalsSignIndex = line.indexOf("=", commaIndex); + String jdbcType = line.substring(equalsSignIndex + 1, endIndex).trim(); + + if (jdbcType.contains("blobType")) { // quick-fix for reading ${blobType} + jdbcType = line.substring(equalsSignIndex + 1, endIndex + 1).trim(); + } + + // Special handling when it's just passing parameter + if ("parameter".equals(parameterName)) { + + assertThat(jdbcType) + .withFailMessage("No jdbcType in " + mappedResource + " on line " + lineCounter + " for resource ") + .isNotNull(); + + } else { + + String expectedParameterType = getParameterType(mappedResource, parameterName); + assertThat(expectedParameterType) + .withFailMessage("No jdbcType configured in " + EntityParameterTypesOverview.class + " for parameter '" + parameterName + + "' on line " + lineCounter + " for resource " + mappedResource) + .isNotNull(); + assertThat(jdbcType) + .withFailMessage("Wrong jdbcType in " + mappedResource + " on line " + lineCounter + " for resource " + mappedResource + + ", should be " + expectedParameterType + ", but was " + jdbcType) + .isEqualTo(expectedParameterType); + } + } + + } + + } + } + } + } + } + + /* + * Helper Methods + */ + protected Class getAndAssertEntityInterfaceClass(Document mappingFileContent, String mappedEntity) { String entityPackage = getEntityPackageFromMapperElement(mappingFileContent); String expectedClass = entityPackage + "." + mappedEntity + "Entity"; @@ -266,7 +385,7 @@ protected Class getAndAssertEntityImplClass(Document mappingFileContent, Stri } /** - * Returns a map {entityName, xmlMappingFileContent} + * Returns a map {entityName, xmlMappingFileContent as Document} */ private Map readMappingFile(EntityMappingPackageInformation packageInformation) { try { @@ -305,6 +424,35 @@ private Document readXmlDocument(String resourceLocation) throws ParserConfigura return docBuilder.parse(this.getClass().getClassLoader().getResourceAsStream(resourceLocation)); } + /** + * Returns a map {entityName, xmlMappingFileContent as Document} + */ + private Map readMappingFileAsString(EntityMappingPackageInformation packageInformation) { + try { + Document mappingsFile = readXmlDocument(packageInformation.getBasePackageFolder() + "/db/mapping/mappings.xml"); + Map resources = new HashMap<>(); + NodeList nodeList = mappingsFile.getElementsByTagName("mapper"); + for (int i = 0; i < nodeList.getLength(); i++) { + Node node = nodeList.item(i); + String resource = node.getAttributes().getNamedItem("resource").getTextContent(); + Matcher resourceMatcher = ENTITY_RESOURCE_PATTERN.matcher(resource); + if (resourceMatcher.matches()) { + String entity = resourceMatcher.group(1); + String entityMappingXmlContent = IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream(resource), StandardCharsets.UTF_8); + resources.put(entity, entityMappingXmlContent); + } + } + + resources.remove("TableData"); // not an entity + + assertFalse(resources.isEmpty()); + + return resources; + } catch (Exception e) { + throw new FlowableException("Error getting mapped resources", e); + } + } + private String getEntityPackageFromMapperElement(Document mappingFileContent) { Node mapperNode = findChildNodes(mappingFileContent, "mapper").get(1); // 1 --> the first element is ALL_PARAMS = new HashMap<>(); + + + static { + // For Liquibase-managed engines, the type will most often be VARCHAR + // For 'older' engines, the type will always be nvarchar. + + // BPMN + addActivityInstanceParams(); + addAttachmentParams(); + addBatchParams(); + addByteArrayParams(); + addCommentParams(); + addDeploymentParams(); + addHistoricEntityLinkParams(); + addEventLogEntryParams(); + addExecutionParams(); + addExternalWorkerJobParams(); + addHistoricActivityInstanceParams(); + addHistoricDetailParams(); + addHistoricProcessInstanceParams(); + addHistoricTaskInstanceParams(); + addJobParams(); + addModelParams(); + addProcessDefinitionParams(); + addProcessDefinitionInfoParams(); + addPropertyParams(); + addResourceParams(); + addTaskParams(); + addTimerJobParams(); + addVariableInstanceParams(); + + // CMMN + addCaseDefinitionParams(); + addCaseInstanceParams(); + addCmmnDeploymentParams(); + addCmmnResourceParams(); + addHistoricCaseInstanceParams(); + addHistoricMilestoneInstanceParams(); + addHistoricPlanItemInstanceParams(); + addMilestoneInstanceParams(); + addPlanItemInstanceParams(); + addSentryPartInstanceParams(); + + // EVENT REGISTRY + addChannelDefinitionParams(); + addEventDefinitionParams(); + addEventDeploymentParams(); + addEventResourceParams(); + + // DMN + addDecisionParams(); + addDmnDeploymentParams(); + addHistoricDecisionExecutionParams(); + addDmnResourceParams(); + + // SERVICES + addBatchPartParams(); + addDeadLetterJobParams(); + addEntityLinkParams(); + addEventSubscriptionParams(); + addHistoricIdentityLinkParams(); + addHistoryJobParams(); + addHistoricTaskLogEntryParams(); + addHistoricVariableInstanceParams(); + addIdentityLinkParams(); + addSuspendedJobParams(); + + // App + addAppDefinitionParams(); + addAppDeploymentParams(); + addAppResourceParams(); + + // IDM + addGroupParams(); + addIdmByteArrayParams(); + addPrivilegeParams(); + addPrivilegeMappingParams(); + addIdentityInfoParams(); + addIdmPropertyParams(); + addMembershipParams(); + addTokenParams(); + addUserParams(); + } + + protected static void addActivityInstanceParams() { + ParameterInfo info = addParameterInfo("activityInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_ID_", "activityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CALL_PROC_INST_ID_", "calledProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_NAME_", "activityName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_TYPE_", "activityType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ASSIGNEE_", "assignee", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("END_TIME_", "endTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TRANSACTION_ORDER_", "transactionOrder", PARAMETER_TYPE_INTEGER); + info.addColumn("DURATION_", "durationInMillis", PARAMETER_TYPE_BIGINT); + info.addColumn("DELETE_REASON_", "deleteReason", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("activityInstanceId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addBatchParams() { + ParameterInfo info = addParameterInfo("batch"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("TYPE_", "batchType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SEARCH_KEY_", "batchSearchKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SEARCH_KEY2_", "batchSearchKey2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("COMPLETE_TIME_", "completeTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("STATUS_", "status", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BATCH_DOC_ID_", "batchDocRefId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("searchKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("searchKey2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter.searchKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter.searchKey2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("batchTypeItem", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("createTimeHigherThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createTimeLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completeTimeLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completeTimeHigherThan", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addByteArrayParams() { + ParameterInfo info = addParameterInfo("byteArray"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addAttachmentParams() { + ParameterInfo info = addParameterInfo("attachment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("URL_", "url", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CONTENT_ID_", "contentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TIME_", "time", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addCommentParams() { + ParameterInfo info = addParameterInfo("comment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TIME_", "time", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACTION_", "action", PARAMETER_TYPE_NVARCHAR); + info.addColumn("MESSAGE_", "message", PARAMETER_TYPE_NVARCHAR); + info.addColumn("FULL_MSG_", "fullMessageBytes", PARAMETER_TYPE_BLOBTYPE); + } + + protected static void addDeploymentParams() { + ParameterInfo info = addParameterInfo("deployment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DEPLOY_TIME_", "deploymentTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("DERIVED_FROM_", "derivedFrom", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DERIVED_FROM_ROOT_", "derivedFromRoot", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PARENT_DEPLOYMENT_ID_", "parentDeploymentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ENGINE_VERSION_", "engineVersion", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addHistoricEntityLinkParams() { + ParameterInfo info = addParameterInfo("historicEntityLink"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LINK_TYPE_", "linkType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PARENT_ELEMENT_ID_", "parentElementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REF_SCOPE_ID_", "referenceScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REF_SCOPE_TYPE_", "referenceScopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REF_SCOPE_DEFINITION_ID_", "referenceScopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ROOT_SCOPE_ID_", "rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ROOT_SCOPE_TYPE_", "rootScopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("HIERARCHY_TYPE_", "hierarchyType", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addEventLogEntryParams() { + ParameterInfo info = addParameterInfo("eventLogEntry"); + info.addColumn("LOG_NR_", "logNr", PARAMETER_TYPE_BIGINT); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TIME_STAMP_", "timeStamp", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DATA_", "data", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_TIME_", "lockTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("IS_PROCESSED_", "isProcessed", PARAMETER_TYPE_INTEGER); + + // Query + info.addQueryParameter("startLogNr", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("endLogNr", PARAMETER_TYPE_BIGINT); + } + + protected static void addExecutionParams() { + ParameterInfo info = addParameterInfo("execution"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BUSINESS_KEY_", "businessKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BUSINESS_STATUS_", "businessStatus", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_ID_", "activityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("IS_ACTIVE_", "isActive", PARAMETER_TYPE_BOOLEAN); + info.addColumn("IS_CONCURRENT_", "isConcurrent", PARAMETER_TYPE_BOOLEAN); + info.addColumn("IS_SCOPE_", "isScope", PARAMETER_TYPE_BOOLEAN); + info.addColumn("IS_EVENT_SCOPE_", "isEventScope", PARAMETER_TYPE_BOOLEAN); + info.addColumn("IS_MI_ROOT_", "isMultiInstanceRoot", PARAMETER_TYPE_BOOLEAN); + info.addColumn("PARENT_ID_", "parentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUPER_EXEC_", "superExecutionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ROOT_PROC_INST_ID_", "rootProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUSPENSION_STATE_", "suspensionState", PARAMETER_TYPE_INTEGER); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_ACT_ID_", "startActivityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("START_USER_ID_", "startUserId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("IS_COUNT_ENABLED_", "isCountEnabled", PARAMETER_TYPE_BOOLEAN); + info.addColumn("EVT_SUBSCR_COUNT_", "eventSubscriptionCount", PARAMETER_TYPE_INTEGER); + info.addColumn("TASK_COUNT_", "taskCount", PARAMETER_TYPE_INTEGER); + info.addColumn("JOB_COUNT_", "jobCount", PARAMETER_TYPE_INTEGER); + info.addColumn("TIMER_JOB_COUNT_", "timerJobCount", PARAMETER_TYPE_INTEGER); + info.addColumn("SUSP_JOB_COUNT_", "suspendedJobCount", PARAMETER_TYPE_INTEGER); + info.addColumn("DEADLETTER_JOB_COUNT_", "deadLetterJobCount", PARAMETER_TYPE_INTEGER); + info.addColumn("EXTERNAL_WORKER_JOB_COUNT_", "externalWorkerJobCount", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_COUNT_", "variableCount", PARAMETER_TYPE_INTEGER); + info.addColumn("ID_LINK_COUNT_", "identityLinkCount", PARAMETER_TYPE_INTEGER); + info.addColumn("CALLBACK_ID_", "callbackId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CALLBACK_TYPE_", "callbackType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REFERENCE_ID_", "referenceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REFERENCE_TYPE_", "referenceType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROPAGATED_STAGE_INST_ID_", "propagatedStageInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_TIME_", "lockTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + + // Process instance + info.addColumn("ProcessDefinitionName", "processDefinitionName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ProcessDefinitionKey", "processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ProcessDefinitionVersion", "processDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addColumn("ProcessDefinitionCategory", "processDefinitionCategory", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ProcessDefinitionEngineVersion", "processDefinitionEngineVersion", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DeploymentId", "deploymentId", PARAMETER_TYPE_NVARCHAR); + + // Variables + addVariableColumnsWhenUsedInQueries(info); + + info.addQueryParameter("executionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("expirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("parentExecutionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("superProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("subProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("activeActivityId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addQueryParameter("startedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedBy", PARAMETER_TYPE_NVARCHAR); + + // Event + info.addQueryParameter("eventSubscriptionValue.eventType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("eventSubscriptionValue.eventName", PARAMETER_TYPE_NVARCHAR); + + // Identity link + info.addQueryParameter("involvedUserIdentityLink.userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + + // EntityLink + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addExternalWorkerJobParams() { + ParameterInfo info = addParameterInfo("externalWorkerJob"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "jobType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_EXP_TIME_", "lockExpirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXCLUSIVE_", "exclusive", PARAMETER_TYPE_BOOLEAN); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROCESS_INSTANCE_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_NAME_", "elementName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CORRELATION_ID_", "correlationId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RETRIES_", "retries", PARAMETER_TYPE_INTEGER); + info.addColumn("EXCEPTION_STACK_ID_", "exceptionByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXCEPTION_MSG_", "exceptionMessage", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_TYPE_", "jobHandlerType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_CFG_", "jobHandlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CUSTOM_VALUES_ID_", "customValuesByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DUEDATE_", "duedate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("REPEAT_", "repeat", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("workerId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("jobId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("topic", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("authorizedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("jobExecutionScope", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("now", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("handlerType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("handlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("duedateHigherThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addHistoricActivityInstanceParams() { + ParameterInfo info = addParameterInfo("historicActivityInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_ID_", "activityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CALL_PROC_INST_ID_", "calledProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_NAME_", "activityName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_TYPE_", "activityType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ASSIGNEE_", "assignee", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("END_TIME_", "endTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TRANSACTION_ORDER_", "transactionOrder", PARAMETER_TYPE_INTEGER); + info.addColumn("DURATION_", "durationInMillis", PARAMETER_TYPE_BIGINT); + info.addColumn("DELETE_REASON_", "deleteReason", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("activityInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("startedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("finishedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("finishedAfter", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addHistoricDetailParams() { + ParameterInfo info = addParameterInfo("historicDetail", "historicFormProperty", "historicDetailVariableInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACT_INST_ID_", "activityInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TIME_", "time", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_TYPE_", "variableType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACTIVITY_ID_", "activityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BYTEARRAY_ID_", "byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DOUBLE_", "doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("TEXT_", "textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TEXT2_", "textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LONG_", "longValue", PARAMETER_TYPE_BIGINT); + + info.addQueryParameter("detailType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("variableName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("propertyId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("propertyValue", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addHistoricProcessInstanceParams() { + ParameterInfo info = addParameterInfo("historicProcessInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BUSINESS_KEY_", "businessKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BUSINESS_STATUS_", "businessStatus", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_NAME_", "processDefinitionName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_KEY_", "processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_VERSION_", "processDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addColumn("PROC_DEF_CATEGORY_", "processDefinitionCategory", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("END_TIME_", "endTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("DURATION_", "durationInMillis", PARAMETER_TYPE_BIGINT); + info.addColumn("START_USER_ID_", "startUserId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_ACT_ID_", "startActivityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("END_ACT_ID_", "endActivityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUPER_PROCESS_INSTANCE_ID_", "superProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DELETE_REASON_", "deleteReason", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CALLBACK_ID_", "callbackId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CALLBACK_TYPE_", "callbackType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REFERENCE_ID_", "referenceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REFERENCE_TYPE_", "referenceType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROPAGATED_STAGE_INST_ID_", "propagatedStageInstanceId", PARAMETER_TYPE_NVARCHAR); + + addVariableColumnsWhenUsedInQueries(info); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("superProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("subProcessInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("activeActivityId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("startedBy", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("startedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("finishedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("finishedAfter", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroup", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("group", PARAMETER_TYPE_NVARCHAR); + + // EntityLink + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + + } + + protected static void addHistoricTaskInstanceParams() { + ParameterInfo info = addParameterInfo("historicTaskInstance", "historicTask", "task"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("TASK_DEF_ID_", "taskDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROPAGATED_STAGE_INST_ID_", "propagatedStageInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("STATE_", "state", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PARENT_TASK_ID_", "parentTaskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_NVARCHAR); + info.addColumn("OWNER_", "owner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ASSIGNEE_", "assignee", PARAMETER_TYPE_NVARCHAR); + info.addColumn("START_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("IN_PROGRESS_TIME_", "inProgressStartTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("IN_PROGRESS_STARTED_BY_", "inProgressStartedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CLAIM_TIME_", "claimTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("CLAIMED_BY_", "claimedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUSPENDED_TIME_", "suspendedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("SUSPENDED_BY_", "suspendedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("END_TIME_", "endTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("COMPLETED_BY_", "completedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DURATION_", "durationInMillis", PARAMETER_TYPE_BIGINT); + info.addColumn("DELETE_REASON_", "deleteReason", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_DEF_KEY_", "taskDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("FORM_KEY_", "formKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PRIORITY_", "priority", PARAMETER_TYPE_INTEGER); + info.addColumn("IN_PROGRESS_DUE_DATE_", "inProgressStartDueDate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("DUE_DATE_", "dueDate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LAST_UPDATED_TIME_", "lastUpdateTime", PARAMETER_TYPE_TIMESTAMP); + + addVariableColumnsWhenUsedInQueries(info); + addIdentityLinkColumsWhenUsedInQueries(info); + + info.addColumn("ILINK_CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("cmmnDeploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("historicTaskInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processCategory", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processInstanceBusinessKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processInstanceIdWithChildren", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseInstanceIdWithChildren", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskParentTaskId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskDescription", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskCategory", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskDeleteReason", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskOwner", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskAssignee", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("assigneeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskPriority", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("taskMinPriority", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("taskMaxPriority", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("createTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("inProgressStartTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("inProgressStartTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("claimTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("claimTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("suspendedTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("suspendedTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("inProgressStartDueBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("inProgressStartDueAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("dueBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("dueAfter", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("queryVar.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVar.scopeType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVar.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVar.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVar.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVar.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVar.doubleValue", PARAMETER_TYPE_DOUBLE); + + // EntityLink + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + + // Identitylink + info.addQueryParameter("candidateUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("group", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addJobParams() { + ParameterInfo info = addParameterInfo("job"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "jobType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_EXP_TIME_", "lockExpirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXCLUSIVE_", "exclusive", PARAMETER_TYPE_BOOLEAN); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROCESS_INSTANCE_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_NAME_", "elementName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CORRELATION_ID_", "correlationId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RETRIES_", "retries", PARAMETER_TYPE_INTEGER); + info.addColumn("EXCEPTION_STACK_ID_", "exceptionByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXCEPTION_MSG_", "exceptionMessage", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_TYPE_", "jobHandlerType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_CFG_", "jobHandlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CUSTOM_VALUES_ID_", "customValuesByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DUEDATE_", "duedate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("REPEAT_", "repeat", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("jobId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("jobExecutionScope", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("now", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("handlerType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("handlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("duedateHigherThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addModelParams() { + ParameterInfo info = addParameterInfo("model"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_UPDATE_TIME_", "lastUpdateTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("META_INFO_", "metaInfo", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EDITOR_SOURCE_VALUE_ID_", "editorSourceValueId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EDITOR_SOURCE_EXTRA_VALUE_ID_", "editorSourceExtraValueId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addProcessDefinitionParams() { + ParameterInfo info = addParameterInfo("processDefinition"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RESOURCE_NAME_", "resourceName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DGRM_RESOURCE_NAME_", "diagramResourceName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HAS_START_FORM_KEY_", "hasStartFormKey", PARAMETER_TYPE_BOOLEAN); + info.addColumn("HAS_GRAPHICAL_NOTATION_", "isGraphicalNotationDefined", PARAMETER_TYPE_BOOLEAN); + info.addColumn("SUSPENSION_STATE_", "suspensionState", PARAMETER_TYPE_INTEGER); + info.addColumn("DERIVED_FROM_", "derivedFrom", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DERIVED_FROM_ROOT_", "derivedFromRoot", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DERIVED_VERSION_", "derivedVersion", PARAMETER_TYPE_INTEGER); + info.addColumn("ENGINE_VERSION_", "engineVersion", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("versionGt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("suspensionState.stateCode", PARAMETER_TYPE_INTEGER); + + info.addQueryParameter("parentDeploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionVersion", PARAMETER_TYPE_INTEGER); + + info.addQueryParameter("eventSubscriptionType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("eventSubscriptionName", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("authorizationUserId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + + } + + protected static void addProcessDefinitionInfoParams() { + ParameterInfo info = addParameterInfo("processDefinitionInfo"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("INFO_JSON_ID_", "infoJsonId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addPropertyParams() { + ParameterInfo info = addParameterInfo("property"); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VALUE_", "value", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + } + + protected static void addResourceParams() { + ParameterInfo info = addParameterInfo("resource"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("GENERATED_", "generated", PARAMETER_TYPE_BOOLEAN); + + info.addQueryParameter("resourceName", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addTaskParams() { + ParameterInfo info = addParameterInfo("task"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PARENT_TASK_ID_", "parentTaskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PRIORITY_", "priority", PARAMETER_TYPE_INTEGER); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP ); + info.addColumn("IN_PROGRESS_TIME_", "inProgressStartTime", PARAMETER_TYPE_TIMESTAMP ); + info.addColumn("IN_PROGRESS_STARTED_BY_", "inProgressStartedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CLAIM_TIME_", "claimTime", PARAMETER_TYPE_TIMESTAMP ); + info.addColumn("CLAIMED_BY_", "claimedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUSPENDED_TIME_", "suspendedTime", PARAMETER_TYPE_TIMESTAMP ); + info.addColumn("SUSPENDED_BY_", "suspendedBy", PARAMETER_TYPE_NVARCHAR); + info.addColumn("OWNER_", "owner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ASSIGNEE_", "assignee", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DELEGATION_", "delegationStateString", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR ); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR ); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_DEF_ID_", "taskDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROPAGATED_STAGE_INST_ID_", "propagatedStageInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_DEF_KEY_", "taskDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("STATE_", "state", PARAMETER_TYPE_NVARCHAR); + info.addColumn("IN_PROGRESS_DUE_DATE_", "inProgressStartDueDate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("DUE_DATE_", "dueDate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR ); + info.addColumn("SUSPENSION_STATE_", "suspensionState", PARAMETER_TYPE_INTEGER ); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR ); + info.addColumn("FORM_KEY_", "formKey", PARAMETER_TYPE_NVARCHAR ); + info.addColumn("IS_COUNT_ENABLED_", "isCountEnabled", PARAMETER_TYPE_BOOLEAN ); + info.addColumn("VAR_COUNT_", "variableCount", PARAMETER_TYPE_INTEGER ); + info.addColumn("ID_LINK_COUNT_", "identityLinkCount", PARAMETER_TYPE_INTEGER ); + info.addColumn("SUB_TASK_COUNT_", "subTaskCount", PARAMETER_TYPE_INTEGER ); + + // Task Query + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("orQueryObject.deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("assigneeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("candidateUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_VARCHAR); // CMMN = liquibase + info.addQueryParameter("caseInstanceIdWithChildren", PARAMETER_TYPE_VARCHAR); // CMMN = liquibase + info.addQueryParameter("cmmnDeploymentId", PARAMETER_TYPE_VARCHAR); // CMMN = liquibase + info.addQueryParameter("createTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("dueAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("dueBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("inProgressStartTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("inProgressStartTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("key", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("maxPriority", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("minPriority", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); // From entity link + info.addQueryParameter("processCategory", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processInstanceBusinessKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processInstanceIdWithChildren", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("userIdForCandidateAndAssignee", PARAMETER_TYPE_NVARCHAR); + + // Variables are returned together with tasks + addVariableColumnsWhenUsedInQueries(info); + + // Identitylinks + addIdentityLinkColumsWhenUsedInQueries(info); + + } + + private static void addIdentityLinkColumsWhenUsedInQueries(ParameterInfo info) { + info.addColumn("ILINK_ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ILINK_TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ILINK_USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ILINK_GROUP_ID_", "groupId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ILINK_TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ILINK_PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ILINK_PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addVariableColumnsWhenUsedInQueries(ParameterInfo info) { + info.addColumn("VAR_ID_", "var.id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_NAME_", "var.name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TYPE_", "var.type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_REV_", "var.revision", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_PROC_INST_ID_", "var.processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_EXECUTION_ID_", "var.executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TASK_ID_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_META_INFO_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_BYTEARRAY_ID_", "var.byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_DOUBLE_", "var.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("VAR_TEXT_", "var.textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TEXT2_", "var.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_LONG_", "var.longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("VAR_SCOPE_ID_", "var.scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SUB_SCOPE_ID_", "var.subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SCOPE_TYPE_", "var.scopeType", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addCaseDefinitionParams() { + ParameterInfo info = addParameterInfo("caseDefinition"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_NAME_", "resourceName", PARAMETER_TYPE_VARCHAR); + info.addColumn("DGRM_RESOURCE_NAME_", "diagramResourceName", PARAMETER_TYPE_VARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_VARCHAR); + info.addColumn("HAS_START_FORM_KEY_", "hasStartFormKey", PARAMETER_TYPE_BOOLEAN); + info.addColumn("HAS_GRAPHICAL_NOTATION_", "isGraphicalNotationDefined", PARAMETER_TYPE_BOOLEAN); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentDeploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter.caseDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter.caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("parameter.tenantId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("versionGt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("authorizationUserId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("authorizationGroup", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addCaseInstanceParams() { + ParameterInfo info = addParameterInfo("caseInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "rev", PARAMETER_TYPE_INTEGER); + info.addColumn("PARENT_ID_", "parentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("BUSINESS_KEY_", "businessKey", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("STATE_", "state", PARAMETER_TYPE_VARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("START_USER_ID_", "startUserId", PARAMETER_TYPE_VARCHAR); + info.addColumn("LAST_REACTIVATION_TIME_", "lastReactivationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_REACTIVATION_USER_ID_", "lastReactivationUserId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CALLBACK_ID_", "callbackId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CALLBACK_TYPE_", "callbackType", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_ID_", "referenceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_TYPE_", "referenceType", PARAMETER_TYPE_VARCHAR); + info.addColumn("IS_COMPLETEABLE_", "completeable", PARAMETER_TYPE_BOOLEAN); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("BUSINESS_STATUS_", "businessStatus", PARAMETER_TYPE_VARCHAR); + info.addColumn("LOCK_TIME_", "lockTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_VARCHAR); + info.addColumn("CaseDefinitionKey", "caseDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addColumn("CaseDefinitionName", "caseDefinitionName", PARAMETER_TYPE_VARCHAR); + info.addColumn("CaseDefinitionVersion", "caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addColumn("CaseDefinitionDeploymentId", "caseDefinitionDeploymentId", PARAMETER_TYPE_VARCHAR); + + // Variables are returned together with case instances + info.addColumn("VAR_ID_", "var.id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_NAME_", "var.name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TYPE_", "var.type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_REV_", "var.revision", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_PROC_INST_ID_", "var.processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_EXECUTION_ID_", "var.executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TASK_ID_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_META_INFO_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_BYTEARRAY_ID_", "var.byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_DOUBLE_", "var.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("VAR_TEXT_", "var.textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TEXT2_", "var.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_LONG_", "var.longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("VAR_SCOPE_ID_", "var.scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SUB_SCOPE_ID_", "var.subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SCOPE_TYPE_", "var.scopeType", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("planItemInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("expirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("caseDefinitionCategory", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("caseInstanceParentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("startedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedBy", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("lastReactivatedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastReactivatedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastReactivatedBy", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("activePlanItemDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroup", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addCmmnDeploymentParams() { + ParameterInfo info = addParameterInfo("cmmnDeployment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOY_TIME_", "deploymentTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("PARENT_DEPLOYMENT_ID_", "parentDeploymentId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("nameLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryNotEquals", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("keyLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("tenantIdLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentDeploymentIdLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addCmmnResourceParams() { + ParameterInfo info = addParameterInfo("cmmnResource"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("GENERATED_", "generated", PARAMETER_TYPE_BOOLEAN); + + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addHistoricCaseInstanceParams() { + ParameterInfo info = addParameterInfo("historicCaseInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "rev", PARAMETER_TYPE_INTEGER); + info.addColumn("PARENT_ID_", "parentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("BUSINESS_KEY_", "businessKey", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("STATE_", "state", PARAMETER_TYPE_VARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("START_USER_ID_", "startUserId", PARAMETER_TYPE_VARCHAR); + info.addColumn("END_TIME_", "endTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_REACTIVATION_TIME_", "lastReactivationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_REACTIVATION_USER_ID_", "lastReactivationUserId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CALLBACK_ID_", "callbackId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CALLBACK_TYPE_", "callbackType", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_ID_", "referenceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_TYPE_", "referenceType", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("BUSINESS_STATUS_", "businessStatus", PARAMETER_TYPE_VARCHAR); + info.addColumn("CaseDefinitionKey", "caseDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addColumn("CaseDefinitionName", "caseDefinitionName", PARAMETER_TYPE_VARCHAR); + info.addColumn("CaseDefinitionVersion", "caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addColumn("CaseDefinitionDeploymentId", "caseDefinitionDeploymentId", PARAMETER_TYPE_VARCHAR); + + // Variables are returned together with case instances + info.addColumn("VAR_ID_", "var.id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_NAME_", "var.name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TYPE_", "var.type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_REV_", "var.revision", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_PROC_INST_ID_", "var.processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_EXECUTION_ID_", "var.executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TASK_ID_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_META_INFO_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_BYTEARRAY_ID_", "var.byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_DOUBLE_", "var.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("VAR_TEXT_", "var.textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TEXT2_", "var.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_LONG_", "var.longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("VAR_SCOPE_ID_", "var.scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SUB_SCOPE_ID_", "var.subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SCOPE_TYPE_", "var.scopeType", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("planItemInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("expirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionCategory", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("caseInstanceParentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseInstanceName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("startedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("finishedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("finishedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedBy", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("lastReactivatedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastReactivatedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastReactivatedBy", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("activePlanItemDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedUserIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroup", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroupIdentityLink.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + } + + protected static void addHistoricMilestoneInstanceParams() { + ParameterInfo info = addParameterInfo("historicMilestoneInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("TIME_STAMP_", "timeStamp", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("CASE_INST_ID_", "caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("milestoneInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("reachedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("reachedAfter", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addHistoricPlanItemInstanceParams() { + ParameterInfo info = addParameterInfo("historicPlanItemInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DERIVED_CASE_DEF_ID_", "derivedCaseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_INST_ID_", "caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("STAGE_INST_ID_", "stageInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("IS_STAGE_", "isStage", PARAMETER_TYPE_BOOLEAN); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ITEM_DEFINITION_ID_", "planItemDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ITEM_DEFINITION_TYPE_", "planItemDefinitionType", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("STATE_", "state", PARAMETER_TYPE_VARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_AVAILABLE_TIME_", "lastAvailableTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_UNAVAILABLE_TIME_", "lastUnavailableTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_ENABLED_TIME_", "lastEnabledTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_DISABLED_TIME_", "lastDisabledTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_STARTED_TIME_", "lastStartedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_SUSPENDED_TIME_", "lastSuspendedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("COMPLETED_TIME_", "completedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("OCCURRED_TIME_", "occurredTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TERMINATED_TIME_", "terminatedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXIT_TIME_", "exitTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("ENDED_TIME_", "endedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_UPDATED_TIME_", "lastUpdatedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("START_USER_ID_", "startUserId", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_ID_", "referenceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_TYPE_", "referenceType", PARAMETER_TYPE_VARCHAR); + info.addColumn("IS_COMPLETEABLE_", "completable", PARAMETER_TYPE_BOOLEAN); + info.addColumn("ENTRY_CRITERION_ID_", "entryCriterionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("EXIT_CRITERION_ID_", "exitCriterionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("EXTRA_VALUE_", "extraValue", PARAMETER_TYPE_VARCHAR); + info.addColumn("SHOW_IN_OVERVIEW_", "showInOverview", PARAMETER_TYPE_BOOLEAN); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + // Variables are returned together with case instances + info.addColumn("VAR_ID_", "var.id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_NAME_", "var.name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TYPE_", "var.type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_REV_", "var.revision", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_PROC_INST_ID_", "var.processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_EXECUTION_ID_", "var.executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TASK_ID_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_META_INFO_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_BYTEARRAY_ID_", "var.byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_DOUBLE_", "var.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("VAR_TEXT_", "var.textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TEXT2_", "var.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_LONG_", "var.longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("VAR_SCOPE_ID_", "var.scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SUB_SCOPE_ID_", "var.subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SCOPE_TYPE_", "var.scopeType", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("planItemInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("planItemInstanceName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("expirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("caseDefinitionCategory", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("caseInstanceParentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("createdBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createdAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastAvailableBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastAvailableAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastUnavailableBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastUnavailableAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastEnabledBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastEnabledAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastDisabledBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastDisabledAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastStartedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastStartedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastSuspendedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastSuspendedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("occurredBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("occurredAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("terminatedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("terminatedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("exitBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("exitAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("endedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("endedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedBy", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("onlyStages", PARAMETER_TYPE_BOOLEAN); + info.addQueryParameter("formKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroup", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addQueryParameter("parameter.caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter.planItemId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter.stageInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addMilestoneInstanceParams() { + ParameterInfo info = addParameterInfo("milestoneInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("TIME_STAMP_", "timeStamp", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("CASE_INST_ID_", "caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("milestoneInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("reachedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("reachedAfter", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addPlanItemInstanceParams() { + ParameterInfo info = addParameterInfo("planItemInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DERIVED_CASE_DEF_ID_", "derivedCaseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_INST_ID_", "caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("STAGE_INST_ID_", "stageInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("IS_STAGE_", "isStage", PARAMETER_TYPE_BOOLEAN); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ITEM_DEFINITION_ID_", "planItemDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ITEM_DEFINITION_TYPE_", "planItemDefinitionType", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("STATE_", "state", PARAMETER_TYPE_VARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_AVAILABLE_TIME_", "lastAvailableTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_UNAVAILABLE_TIME_", "lastUnavailableTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_ENABLED_TIME_", "lastEnabledTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_DISABLED_TIME_", "lastDisabledTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_STARTED_TIME_", "lastStartedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_SUSPENDED_TIME_", "lastSuspendedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("COMPLETED_TIME_", "completedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("OCCURRED_TIME_", "occurredTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TERMINATED_TIME_", "terminatedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXIT_TIME_", "exitTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("ENDED_TIME_", "endedTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("START_USER_ID_", "startUserId", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_ID_", "referenceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("REFERENCE_TYPE_", "referenceType", PARAMETER_TYPE_VARCHAR); + info.addColumn("IS_COMPLETEABLE_", "completable", PARAMETER_TYPE_BOOLEAN); + info.addColumn("ENTRY_CRITERION_ID_", "entryCriterionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("EXIT_CRITERION_ID_", "exitCriterionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("EXTRA_VALUE_", "extraValue", PARAMETER_TYPE_VARCHAR); + info.addColumn("IS_COUNT_ENABLED_", "countEnabled", PARAMETER_TYPE_BOOLEAN); + info.addColumn("VAR_COUNT_", "variableCount", PARAMETER_TYPE_INTEGER); + info.addColumn("SENTRY_PART_INST_COUNT_", "sentryPartInstanceCount", PARAMETER_TYPE_INTEGER); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + // Variables are returned together with case instances + info.addColumn("VAR_ID_", "var.id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_NAME_", "var.name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TYPE_", "var.type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_REV_", "var.revision", PARAMETER_TYPE_INTEGER); + info.addColumn("VAR_PROC_INST_ID_", "var.processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_EXECUTION_ID_", "var.executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TASK_ID_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_META_INFO_", "var.taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_BYTEARRAY_ID_", "var.byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_DOUBLE_", "var.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("VAR_TEXT_", "var.textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TEXT2_", "var.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_LONG_", "var.longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("VAR_SCOPE_ID_", "var.scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SUB_SCOPE_ID_", "var.subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_SCOPE_TYPE_", "var.scopeType", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("planItemInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("expirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("caseDefinitionCategory", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("caseInstanceParentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("createdBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createdAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastAvailableBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastAvailableAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastUnavailableBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastUnavailableAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastEnabledBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastEnabledAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastDisabledBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastDisabledAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastStartedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastStartedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastSuspendedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("lastSuspendedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("completedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("occurredBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("occurredAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("terminatedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("terminatedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("exitBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("exitAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("endedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("endedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("startedBy", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("onlyStages", PARAMETER_TYPE_BOOLEAN); + info.addQueryParameter("formKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("involvedUser", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("involvedGroup", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addQueryParameter("parameter.caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter.planItemId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter.stageInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addSentryPartInstanceParams() { + ParameterInfo info = addParameterInfo("sentryPartInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CASE_DEF_ID_", "caseDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CASE_INST_ID_", "caseInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("PLAN_ITEM_INST_ID_", "planItemInstanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ON_PART_ID_", "onPartId", PARAMETER_TYPE_VARCHAR); + info.addColumn("IF_PART_ID_", "ifPartId", PARAMETER_TYPE_VARCHAR); + info.addColumn("TIME_STAMP_", "timeStamp", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("milestoneInstanceId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("reachedBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("reachedAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addChannelDefinitionParams() { + ParameterInfo info = addParameterInfo("channelDefinition"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_VARCHAR); + info.addColumn("IMPLEMENTATION_", "implementation", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("RESOURCE_NAME_", "resourceName", PARAMETER_TYPE_VARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("channelDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentDeploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryNotEquals", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("nameLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("nameLikeIgnoreCase", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("keyLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("keyLikeIgnoreCase", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("versionGt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("createTimeAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createTimeBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("resourceNameLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("tenantIdLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("eventVersion", PARAMETER_TYPE_INTEGER); + } + + protected static void addEventDefinitionParams() { + ParameterInfo info = addParameterInfo("eventDefinition"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_NAME_", "resourceName", PARAMETER_TYPE_VARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("eventDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentDeploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryNotEquals", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("nameLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("nameLikeIgnoreCase", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("keyLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("keyLikeIgnoreCase", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("versionGt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("resourceNameLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("tenantIdLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("eventVersion", PARAMETER_TYPE_INTEGER); + } + + protected static void addEventDeploymentParams() { + ParameterInfo info = addParameterInfo("eventDeployment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOY_TIME_", "deploymentTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("PARENT_DEPLOYMENT_ID_", "parentDeploymentId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("nameLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("categoryNotEquals", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("tenantIdLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentDeploymentIdLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("eventDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("eventDefinitionKeyLike", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("channelDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("channelDefinitionKeyLike", PARAMETER_TYPE_VARCHAR); + } + + protected static void addEventResourceParams() { + ParameterInfo info = addParameterInfo("eventResource"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("resourceName", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_VARCHAR); + } + + protected static void addTimerJobParams() { + ParameterInfo info = addParameterInfo("timerJob"); + info.addColumn("ID_","id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "jobType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_EXP_TIME_", "lockExpirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXCLUSIVE_", "exclusive", PARAMETER_TYPE_BOOLEAN); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROCESS_INSTANCE_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_NAME_", "elementName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CORRELATION_ID_", "correlationId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RETRIES_", "retries", PARAMETER_TYPE_INTEGER); + info.addColumn("EXCEPTION_STACK_ID_", "exceptionByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXCEPTION_MSG_", "exceptionMessage", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_TYPE_", "jobHandlerType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_CFG_", "jobHandlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CUSTOM_VALUES_ID_", "customValuesByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DUEDATE_", "duedate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("REPEAT_", "repeat", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("handlerType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_VARCHAR); // careful: cmmn engine --> varchar + info.addQueryParameter("now", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("jobExecutionScope", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addVariableInstanceParams() { + ParameterInfo info = addParameterInfo("variableInstance", "variable"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BYTEARRAY_ID_", "byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DOUBLE_", "doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("TEXT_", "textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TEXT2_", "textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LONG_", "longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("META_INFO_", "metaInfo", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("typeName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("variableName", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + } + + protected static void addBatchPartParams() { + ParameterInfo info = addParameterInfo("batchPart"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("BATCH_ID_", "batchId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SEARCH_KEY_", "searchKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SEARCH_KEY2_", "searchKey2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("COMPLETE_TIME_", "completeTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("STATUS_", "status", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RESULT_DOC_ID_", "resultDocRefId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BATCH_TYPE_", "batchType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BATCH_SEARCH_KEY_", "batchSearchKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BATCH_SEARCH_KEY2_", "batchSearchKey2", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("tenantIdLike", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addDeadLetterJobParams() { + ParameterInfo info = addParameterInfo("deadLetterJob"); + info.addColumn("ID_","id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "jobType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_EXP_TIME_", "lockExpirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXCLUSIVE_", "exclusive", PARAMETER_TYPE_BOOLEAN); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROCESS_INSTANCE_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_NAME_", "elementName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CORRELATION_ID_", "correlationId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RETRIES_", "retries", PARAMETER_TYPE_INTEGER); + info.addColumn("EXCEPTION_STACK_ID_", "exceptionByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXCEPTION_MSG_", "exceptionMessage", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_TYPE_", "jobHandlerType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_CFG_", "jobHandlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CUSTOM_VALUES_ID_", "customValuesByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DUEDATE_", "duedate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("REPEAT_", "repeat", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("handlerType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_VARCHAR); // careful: cmmn engine --> varchar + info.addQueryParameter("now", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("jobExecutionScope", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addEntityLinkParams() { + ParameterInfo info = addParameterInfo("entityLink"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LINK_TYPE_", "linkType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PARENT_ELEMENT_ID_", "parentElementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REF_SCOPE_ID_", "referenceScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REF_SCOPE_DEFINITION_ID_", "referenceScopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REF_SCOPE_TYPE_", "referenceScopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ROOT_SCOPE_ID_", "rootScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ROOT_SCOPE_TYPE_", "rootScopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HIERARCHY_TYPE_", "hierarchyType", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addEventSubscriptionParams() { + ParameterInfo info = addParameterInfo("eventSubscription"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("EVENT_TYPE_", "eventType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EVENT_NAME_", "eventName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACTIVITY_ID_", "activityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CONFIGURATION_", "configuration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATED_", "created", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_KEY_", "scopeDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_TIME_", "lockTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + + addEventSubscriptionAlias("messageEventSubscription", info); + addEventSubscriptionAlias("signalEventSubscription", info); + addEventSubscriptionAlias("compensateEventSubscription", info); + + info.addQueryParameter("createdBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("createdAfter", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("eventName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("eventType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("executionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("activityId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("tenantId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("scopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("scopeType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("newTenantId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("oldTenantId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("newProcessDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("oldProcessDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("newScopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("oldScopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("currentTime", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addHistoricIdentityLinkParams() { + ParameterInfo info = addParameterInfo("historicIdentityLink"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("GROUP_ID_", "groupId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("scopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("scopeType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("identityLink.id", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addHistoryJobParams() { + ParameterInfo info = addParameterInfo("historyJob"); + info.addColumn("ID_","id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_","revision", PARAMETER_TYPE_INTEGER); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_EXP_TIME_", "lockExpirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("RETRIES_", "retries", PARAMETER_TYPE_INTEGER); + info.addColumn("EXCEPTION_STACK_ID_", "exceptionByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXCEPTION_MSG_", "exceptionMessage", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ADV_HANDLER_CFG_ID_", "advancedJobHandlerConfigurationByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_TYPE_", "jobHandlerType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_CFG_", "jobHandlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CUSTOM_VALUES_ID_", "customValuesByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("job.id", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("handlerType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("handlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("jobExecutionScope", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("now", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addHistoricTaskLogEntryParams() { + ParameterInfo info = addParameterInfo("historicTaskLogEntry"); + info.addColumn("ID_", "logNumber", PARAMETER_TYPE_BIGINT); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TIME_STAMP_", "timeStamp", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DATA_", "data", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("fromDate", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("toDate", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("fromLogNumber", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("toLogNumber", PARAMETER_TYPE_BIGINT); + } + + protected static void addHistoricVariableInstanceParams() { + ParameterInfo info = addParameterInfo("historicVariableInstance"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "variableName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VAR_TYPE_", "variableType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("META_INFO_", "metaInfo", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BYTEARRAY_ID_", "byteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DOUBLE_", "doubleValue", PARAMETER_TYPE_DOUBLE); + info.addColumn("TEXT_", "textValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TEXT2_", "textValue2", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LONG_", "longValue", PARAMETER_TYPE_BIGINT); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LAST_UPDATED_TIME_", "lastUpdatedTime", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("variable.id", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("variableNameLike", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.name", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.textValue2", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("queryVariableValue.longValue", PARAMETER_TYPE_BIGINT); + info.addQueryParameter("queryVariableValue.doubleValue", PARAMETER_TYPE_DOUBLE); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addIdentityLinkParams() { + ParameterInfo info = addParameterInfo("identityLink"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("GROUP_ID_", "groupId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TASK_ID_", "taskId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("scopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("scopeType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("taskId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("type", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("identityLink.id", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addSuspendedJobParams() { + ParameterInfo info = addParameterInfo("suspendedJob"); + info.addColumn("ID_","id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "jobType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_OWNER_", "lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_EXP_TIME_", "lockExpirationTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("EXCLUSIVE_", "exclusive", PARAMETER_TYPE_BOOLEAN); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROCESS_INSTANCE_ID_", "processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_DEF_ID_", "processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_ID_", "elementId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ELEMENT_NAME_", "elementName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", "scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", "subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", "scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CORRELATION_ID_", "correlationId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("RETRIES_", "retries", PARAMETER_TYPE_INTEGER); + info.addColumn("EXCEPTION_STACK_ID_", "exceptionByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXCEPTION_MSG_", "exceptionMessage", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_TYPE_", "jobHandlerType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("HANDLER_CFG_", "jobHandlerConfiguration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CUSTOM_VALUES_ID_", "customValuesByteArrayRef", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATE_TIME_", "createTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DUEDATE_", "duedate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("REPEAT_", "repeat", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("handlerType", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("processDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("caseDefinitionKey", PARAMETER_TYPE_VARCHAR); // careful: cmmn engine --> varchar + info.addQueryParameter("now", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThan", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateHigherThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("duedateLowerThanOrEqual", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("jobExecutionScope", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("deploymentId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("parameter", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addEventSubscriptionAlias(String alias, ParameterInfo info) { + info.addColumn("ID_", alias + ".id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", alias + ".revision", PARAMETER_TYPE_INTEGER); + info.addColumn("EVENT_TYPE_", alias + ".eventType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EVENT_NAME_", alias + ".eventName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EXECUTION_ID_", alias + ".executionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PROC_INST_ID_", alias + ".processInstanceId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("ACTIVITY_ID_", alias + ".activityId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CONFIGURATION_", alias + ".configuration", PARAMETER_TYPE_NVARCHAR); + info.addColumn("CREATED_", alias + ".created", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("PROC_DEF_ID_", alias + ".processDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SUB_SCOPE_ID_", alias + ".subScopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_ID_", alias + ".scopeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_ID_", alias + ".scopeDefinitionId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_DEFINITION_KEY_", alias + ".scopeDefinitionKey", PARAMETER_TYPE_NVARCHAR); + info.addColumn("SCOPE_TYPE_", alias + ".scopeType", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LOCK_TIME_", alias + ".lockTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("LOCK_OWNER_", alias + ".lockOwner", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", alias + ".tenantId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addDecisionParams() { + ParameterInfo info = addParameterInfo("decision"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_NAME_", "resourceName", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_VARCHAR); + info.addColumn("DECISION_TYPE_", "decisionType", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("decisionId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("parentDeploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("decisionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("decisionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLte", PARAMETER_TYPE_INTEGER); + } + + protected static void addDmnDeploymentParams() { + ParameterInfo info = addParameterInfo("dmnDeployment", "deployment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("PARENT_DEPLOYMENT_ID_", "parentDeploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOY_TIME_", "deploymentTime", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("decisionKey", PARAMETER_TYPE_VARCHAR); + } + + protected static void addHistoricDecisionExecutionParams() { + ParameterInfo info = addParameterInfo("historicDecisionExecution"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("DECISION_DEFINITION_ID_", "decisionDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("START_TIME_", "startTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("END_TIME_", "endTime", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("INSTANCE_ID_", "instanceId", PARAMETER_TYPE_VARCHAR); + info.addColumn("EXECUTION_ID_", "executionId", PARAMETER_TYPE_VARCHAR); + info.addColumn("ACTIVITY_ID_", "activityId", PARAMETER_TYPE_VARCHAR); + info.addColumn("FAILED_", "failed", PARAMETER_TYPE_BOOLEAN); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("EXECUTION_JSON_", "executionJson", PARAMETER_TYPE_VARCHAR); + info.addColumn("SCOPE_TYPE_", "scopeType", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEC_DEF_KEY_", "decisionKey", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEC_DEF_NAME_", "decisionName", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEC_DEF_VERSION_", "decisionVersion", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("decisionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("processInstanceIdWithChildren", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("caseInstanceIdWithChildren", PARAMETER_TYPE_VARCHAR); + } + + protected static void addDmnResourceParams() { + ParameterInfo info = addParameterInfo("dmnResource", "resource"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("resourceName", PARAMETER_TYPE_VARCHAR); + } + + protected static void addAppDefinitionParams() { + ParameterInfo info = addParameterInfo("appDefinition"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("VERSION_", "version", PARAMETER_TYPE_INTEGER); + info.addColumn("DESCRIPTION_", "description", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_NAME_", "resourceName", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("appDefinitionId", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("appDefinitionKey", PARAMETER_TYPE_VARCHAR); + info.addQueryParameter("appDefinitionVersion", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionGte", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLt", PARAMETER_TYPE_INTEGER); + info.addQueryParameter("versionLte", PARAMETER_TYPE_INTEGER); + } + + protected static void addAppDeploymentParams() { + ParameterInfo info = addParameterInfo("appDeployment"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("CATEGORY_", "category", PARAMETER_TYPE_VARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_VARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_VARCHAR); + info.addColumn("DEPLOY_TIME_", "deploymentTime", PARAMETER_TYPE_TIMESTAMP); + + info.addQueryParameter("deploymentId", PARAMETER_TYPE_VARCHAR); + } + + protected static void addAppResourceParams() { + ParameterInfo info = addParameterInfo("appResource", "resource"); + info.addColumn("ID_", "id", PARAMETER_TYPE_VARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_VARCHAR); + info.addColumn("RESOURCE_BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("DEPLOYMENT_ID_", "deploymentId", PARAMETER_TYPE_VARCHAR); + + info.addQueryParameter("resourceName", PARAMETER_TYPE_VARCHAR); + } + + protected static void addGroupParams() { + ParameterInfo info = addParameterInfo("group"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("userId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupType", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addIdmByteArrayParams() { + ParameterInfo info = addParameterInfo("idmByteArray", "byteArray"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("BYTES_", "bytes", PARAMETER_TYPE_BLOBTYPE); + } + + protected static void addPrivilegeMappingParams() { + ParameterInfo info = addParameterInfo("privilege"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("userId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addPrivilegeParams() { + ParameterInfo info = addParameterInfo("privilegeMapping"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PRIV_ID_", "privilegeId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("GROUP_ID_", "groupId", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("userId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addIdentityInfoParams() { + ParameterInfo info = addParameterInfo("identityInfo"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TYPE_", "type", PARAMETER_TYPE_NVARCHAR); + info.addColumn("KEY_", "key", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VALUE_", "value", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PASSWORD_", "passwordBytes", PARAMETER_TYPE_BLOBTYPE); + info.addColumn("PARENT_ID_", "parentId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addIdmPropertyParams() { + ParameterInfo info = addParameterInfo("idmProperty", "property"); + info.addColumn("NAME_", "name", PARAMETER_TYPE_NVARCHAR); + info.addColumn("VALUE_", "value", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + } + + protected static void addMembershipParams() { + ParameterInfo info = addParameterInfo("membership"); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("GROUP_ID_", "groupId", PARAMETER_TYPE_NVARCHAR); + } + + protected static void addTokenParams() { + ParameterInfo info = addParameterInfo("token"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("TOKEN_VALUE_", "tokenValue", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TOKEN_DATE_", "tokenDate", PARAMETER_TYPE_TIMESTAMP); + info.addColumn("IP_ADDRESS_", "ipAddress", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_AGENT_", "userAgent", PARAMETER_TYPE_NVARCHAR); + info.addColumn("USER_ID_", "userId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TOKEN_DATA_", "tokenData", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("tokenDateBefore", PARAMETER_TYPE_TIMESTAMP); + info.addQueryParameter("tokenDateAfter", PARAMETER_TYPE_TIMESTAMP); + } + + protected static void addUserParams() { + ParameterInfo info = addParameterInfo("user"); + info.addColumn("ID_", "id", PARAMETER_TYPE_NVARCHAR); + info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + info.addColumn("FIRST_", "firstName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("LAST_", "lastName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("DISPLAY_NAME_", "displayName", PARAMETER_TYPE_NVARCHAR); + info.addColumn("EMAIL_", "email", PARAMETER_TYPE_NVARCHAR); + info.addColumn("TENANT_ID_", "tenantId", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PWD_", "password", PARAMETER_TYPE_NVARCHAR); + info.addColumn("PICTURE_ID_", "pictureByteArrayRef", PARAMETER_TYPE_NVARCHAR); + + info.addQueryParameter("idIgnoreCase", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("fullName", PARAMETER_TYPE_NVARCHAR); + info.addQueryParameter("groupId", PARAMETER_TYPE_NVARCHAR); + } + + public static String getParameterType(String entity, String parameterName) { + return getParameterInfo(entity).getParameterType(parameterName); + } + + public static String getColumnType(String entity, String columnName) { + return getParameterInfo(entity).getColumnType(columnName); + } + + private static ParameterInfo getParameterInfo(String entity) { + String lowerCasedEntity = entity.toLowerCase(Locale.ROOT); + if (!ALL_PARAMS.containsKey(lowerCasedEntity)) { + throw new RuntimeException("No parameter types found for " + entity); + } + ParameterInfo parameterInfo = ALL_PARAMS.get(lowerCasedEntity); + return parameterInfo; + } + + protected static ParameterInfo addParameterInfo(String alias) { + ParameterInfo parameterInfo = new ParameterInfo(alias); + ALL_PARAMS.put(alias.toLowerCase(Locale.ROOT), parameterInfo); + return parameterInfo; + } + + protected static ParameterInfo addParameterInfo(String alias, String...additionalAliases) { + ParameterInfo parameterInfo = new ParameterInfo(alias, additionalAliases); + ALL_PARAMS.put(alias.toLowerCase(Locale.ROOT), parameterInfo); + return parameterInfo; + } + + protected static class ParameterInfo { + + protected String alias; + protected String[] additionalAliases; + protected Map columnToParameterMap = new HashMap<>(); + protected Map parameterToJdbcTypeMap = new HashMap<>(); + + public ParameterInfo(String alias) { + this.alias = alias; + + // Common for all + addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER); + addQueryParameter("revisionNext", PARAMETER_TYPE_INTEGER); + } + + public ParameterInfo(String alias, String ... additionalAliases) { + this(alias); + this.additionalAliases = additionalAliases; + } + + public ParameterInfo addColumn(String columnName, String parameter, String jdbcType) { + columnToParameterMap.put(columnName, parameter); + addParameter(parameter, jdbcType); + return this; + } + + public ParameterInfo addQueryParameter(String parameter, String jdbcType) { + addParameter(parameter, jdbcType); + return this; + } + + protected void addParameter(String parameter, String jdbcType) { + internalAddParameter(parameter, jdbcType); + + if (jdbcType.equals(PARAMETER_TYPE_NVARCHAR) || jdbcType.equals(PARAMETER_TYPE_VARCHAR)) { + internalAddParameter(parameter + "Like", jdbcType); + internalAddParameter(parameter + "LikeIgnoreCase", jdbcType); + internalAddParameter(parameter + "NotEquals", jdbcType); + } + } + + protected void internalAddParameter(String parameter, String jdbcType) { + parameterToJdbcTypeMap.put(parameter, jdbcType); + parameterToJdbcTypeMap.put(alias + "." + parameter, jdbcType); + parameterToJdbcTypeMap.put("parameter." + parameter, jdbcType); + parameterToJdbcTypeMap.put("orQueryObject." + parameter, jdbcType); + + if (additionalAliases != null) { + for (String additionalAlias : additionalAliases) { + parameterToJdbcTypeMap.put(additionalAlias + "." + parameter, jdbcType); + } + } + } + + public String getColumnType(String columnName) { + String parameterName = columnToParameterMap.get(columnName); + if (StringUtils.isEmpty(parameterName)) { + throw new RuntimeException("No parameter type set for column " + columnName); + } + return getParameterType(parameterName); + } + + public String getParameterType(String parameterName) { + return parameterToJdbcTypeMap.get(parameterName); + } + + } + +} diff --git a/modules/flowable-task-service/src/main/resources/org/flowable/task/service/db/mapping/entity/HistoricTaskInstance.xml b/modules/flowable-task-service/src/main/resources/org/flowable/task/service/db/mapping/entity/HistoricTaskInstance.xml index 84d6c9e2b50..e018b440319 100644 --- a/modules/flowable-task-service/src/main/resources/org/flowable/task/service/db/mapping/entity/HistoricTaskInstance.xml +++ b/modules/flowable-task-service/src/main/resources/org/flowable/task/service/db/mapping/entity/HistoricTaskInstance.xml @@ -59,40 +59,40 @@ TENANT_ID_, LAST_UPDATED_TIME_ ) values ( - #{id ,jdbcType=VARCHAR}, - 1, #{taskDefinitionId, jdbcType=VARCHAR}, - #{processDefinitionId, jdbcType=VARCHAR}, - #{processInstanceId, jdbcType=VARCHAR}, - #{executionId, jdbcType=VARCHAR}, - #{scopeId, jdbcType=VARCHAR}, - #{subScopeId, jdbcType=VARCHAR}, - #{scopeType, jdbcType=VARCHAR}, - #{scopeDefinitionId, jdbcType=VARCHAR}, - #{propagatedStageInstanceId, jdbcType=VARCHAR}, - #{state ,jdbcType=VARCHAR}, - #{name ,jdbcType=VARCHAR}, - #{parentTaskId ,jdbcType=VARCHAR}, - #{description ,jdbcType=VARCHAR}, - #{owner ,jdbcType=VARCHAR}, - #{assignee ,jdbcType=VARCHAR}, + #{id, jdbcType=NVARCHAR}, + 1, #{taskDefinitionId, jdbcType=NVARCHAR}, + #{processDefinitionId, jdbcType=NVARCHAR}, + #{processInstanceId, jdbcType=NVARCHAR}, + #{executionId, jdbcType=NVARCHAR}, + #{scopeId, jdbcType=NVARCHAR}, + #{subScopeId, jdbcType=NVARCHAR}, + #{scopeType, jdbcType=NVARCHAR}, + #{scopeDefinitionId, jdbcType=NVARCHAR}, + #{propagatedStageInstanceId, jdbcType=NVARCHAR}, + #{state, jdbcType=NVARCHAR}, + #{name, jdbcType=NVARCHAR}, + #{parentTaskId, jdbcType=NVARCHAR}, + #{description, jdbcType=NVARCHAR}, + #{owner, jdbcType=NVARCHAR}, + #{assignee, jdbcType=NVARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{inProgressStartTime, jdbcType=TIMESTAMP}, - #{inProgressStartedBy, jdbcType=VARCHAR}, + #{inProgressStartedBy, jdbcType=NVARCHAR}, #{claimTime, jdbcType=TIMESTAMP}, - #{claimedBy, jdbcType=VARCHAR}, + #{claimedBy, jdbcType=NVARCHAR}, #{suspendedTime, jdbcType=TIMESTAMP}, - #{suspendedBy, jdbcType=VARCHAR}, + #{suspendedBy, jdbcType=NVARCHAR}, #{endTime, jdbcType=TIMESTAMP}, - #{completedBy, jdbcType=VARCHAR}, - #{durationInMillis ,jdbcType=BIGINT}, - #{deleteReason ,jdbcType=VARCHAR}, - #{taskDefinitionKey ,jdbcType=VARCHAR}, - #{formKey ,jdbcType=VARCHAR}, + #{completedBy, jdbcType=NVARCHAR}, + #{durationInMillis, jdbcType=BIGINT}, + #{deleteReason, jdbcType=NVARCHAR}, + #{taskDefinitionKey, jdbcType=NVARCHAR}, + #{formKey, jdbcType=NVARCHAR}, #{priority, jdbcType=INTEGER}, #{inProgressStartDueDate, jdbcType=TIMESTAMP}, #{dueDate, jdbcType=TIMESTAMP}, - #{category, jdbcType=VARCHAR}, - #{tenantId, jdbcType=VARCHAR}, + #{category, jdbcType=NVARCHAR}, + #{tenantId, jdbcType=NVARCHAR}, #{lastUpdateTime, jdbcType=TIMESTAMP} ) @@ -137,40 +137,40 @@ LAST_UPDATED_TIME_ ) values - (#{historicTask.id ,jdbcType=VARCHAR}, - 1, #{historicTask.taskDefinitionId, jdbcType=VARCHAR}, - #{historicTask.processDefinitionId, jdbcType=VARCHAR}, - #{historicTask.processInstanceId, jdbcType=VARCHAR}, - #{historicTask.executionId, jdbcType=VARCHAR}, - #{historicTask.scopeId, jdbcType=VARCHAR}, - #{historicTask.subScopeId, jdbcType=VARCHAR}, - #{historicTask.scopeType, jdbcType=VARCHAR}, - #{historicTask.scopeDefinitionId, jdbcType=VARCHAR}, - #{historicTask.propagatedStageInstanceId, jdbcType=VARCHAR}, - #{historicTask.state ,jdbcType=VARCHAR}, - #{historicTask.name ,jdbcType=VARCHAR}, - #{historicTask.parentTaskId ,jdbcType=VARCHAR}, - #{historicTask.description ,jdbcType=VARCHAR}, - #{historicTask.owner ,jdbcType=VARCHAR}, - #{historicTask.assignee ,jdbcType=VARCHAR}, + (#{historicTask.id, jdbcType=NVARCHAR}, + 1, #{historicTask.taskDefinitionId, jdbcType=NVARCHAR}, + #{historicTask.processDefinitionId, jdbcType=NVARCHAR}, + #{historicTask.processInstanceId, jdbcType=NVARCHAR}, + #{historicTask.executionId, jdbcType=NVARCHAR}, + #{historicTask.scopeId, jdbcType=NVARCHAR}, + #{historicTask.subScopeId, jdbcType=NVARCHAR}, + #{historicTask.scopeType, jdbcType=NVARCHAR}, + #{historicTask.scopeDefinitionId, jdbcType=NVARCHAR}, + #{historicTask.propagatedStageInstanceId, jdbcType=NVARCHAR}, + #{historicTask.state, jdbcType=NVARCHAR}, + #{historicTask.name, jdbcType=NVARCHAR}, + #{historicTask.parentTaskId, jdbcType=NVARCHAR}, + #{historicTask.description, jdbcType=NVARCHAR}, + #{historicTask.owner, jdbcType=NVARCHAR}, + #{historicTask.assignee, jdbcType=NVARCHAR}, #{historicTask.createTime, jdbcType=TIMESTAMP}, #{historicTask.inProgressStartTime, jdbcType=TIMESTAMP}, - #{historicTask.inProgressStartedBy, jdbcType=VARCHAR}, + #{historicTask.inProgressStartedBy, jdbcType=NVARCHAR}, #{historicTask.claimTime, jdbcType=TIMESTAMP}, - #{historicTask.claimedBy, jdbcType=VARCHAR}, + #{historicTask.claimedBy, jdbcType=NVARCHAR}, #{historicTask.suspendedTime, jdbcType=TIMESTAMP}, - #{historicTask.suspendedBy, jdbcType=VARCHAR}, + #{historicTask.suspendedBy, jdbcType=NVARCHAR}, #{historicTask.endTime, jdbcType=TIMESTAMP}, - #{historicTask.completedBy, jdbcType=VARCHAR}, - #{historicTask.durationInMillis ,jdbcType=BIGINT}, - #{historicTask.deleteReason ,jdbcType=VARCHAR}, - #{historicTask.taskDefinitionKey ,jdbcType=VARCHAR}, - #{historicTask.formKey ,jdbcType=VARCHAR}, + #{historicTask.completedBy, jdbcType=NVARCHAR}, + #{historicTask.durationInMillis, jdbcType=BIGINT}, + #{historicTask.deleteReason, jdbcType=NVARCHAR}, + #{historicTask.taskDefinitionKey, jdbcType=NVARCHAR}, + #{historicTask.formKey, jdbcType=NVARCHAR}, #{historicTask.priority, jdbcType=INTEGER}, #{historicTask.inProgressStartDueDate, jdbcType=TIMESTAMP}, #{historicTask.dueDate, jdbcType=TIMESTAMP}, - #{historicTask.category, jdbcType=VARCHAR}, - #{historicTask.tenantId, jdbcType=VARCHAR}, + #{historicTask.category, jdbcType=NVARCHAR}, + #{historicTask.tenantId, jdbcType=NVARCHAR}, #{historicTask.lastUpdateTime, jdbcType=TIMESTAMP}) @@ -216,40 +216,40 @@ TENANT_ID_, LAST_UPDATED_TIME_ ) VALUES - (#{historicTask.id ,jdbcType=VARCHAR}, - 1, #{historicTask.taskDefinitionId, jdbcType=VARCHAR}, - #{historicTask.processDefinitionId, jdbcType=VARCHAR}, - #{historicTask.processInstanceId, jdbcType=VARCHAR}, - #{historicTask.executionId, jdbcType=VARCHAR}, - #{historicTask.scopeId, jdbcType=VARCHAR}, - #{historicTask.subScopeId, jdbcType=VARCHAR}, - #{historicTask.scopeType, jdbcType=VARCHAR}, - #{historicTask.scopeDefinitionId, jdbcType=VARCHAR}, - #{historicTask.propagatedStageInstanceId, jdbcType=VARCHAR}, - #{historicTask.state ,jdbcType=VARCHAR}, - #{historicTask.name ,jdbcType=VARCHAR}, - #{historicTask.parentTaskId ,jdbcType=VARCHAR}, - #{historicTask.description ,jdbcType=VARCHAR}, - #{historicTask.owner ,jdbcType=VARCHAR}, - #{historicTask.assignee ,jdbcType=VARCHAR}, + (#{historicTask.id, jdbcType=NVARCHAR}, + 1, #{historicTask.taskDefinitionId, jdbcType=NVARCHAR}, + #{historicTask.processDefinitionId, jdbcType=NVARCHAR}, + #{historicTask.processInstanceId, jdbcType=NVARCHAR}, + #{historicTask.executionId, jdbcType=NVARCHAR}, + #{historicTask.scopeId, jdbcType=NVARCHAR}, + #{historicTask.subScopeId, jdbcType=NVARCHAR}, + #{historicTask.scopeType, jdbcType=NVARCHAR}, + #{historicTask.scopeDefinitionId, jdbcType=NVARCHAR}, + #{historicTask.propagatedStageInstanceId, jdbcType=NVARCHAR}, + #{historicTask.state, jdbcType=NVARCHAR}, + #{historicTask.name, jdbcType=NVARCHAR}, + #{historicTask.parentTaskId, jdbcType=NVARCHAR}, + #{historicTask.description, jdbcType=NVARCHAR}, + #{historicTask.owner, jdbcType=NVARCHAR}, + #{historicTask.assignee, jdbcType=NVARCHAR}, #{historicTask.createTime, jdbcType=TIMESTAMP}, #{historicTask.inProgressStartTime, jdbcType=TIMESTAMP}, - #{historicTask.inProgressStartedBy, jdbcType=VARCHAR}, + #{historicTask.inProgressStartedBy, jdbcType=NVARCHAR}, #{historicTask.claimTime, jdbcType=TIMESTAMP}, - #{historicTask.claimedBy, jdbcType=VARCHAR}, + #{historicTask.claimedBy, jdbcType=NVARCHAR}, #{historicTask.suspendedTime, jdbcType=TIMESTAMP}, - #{historicTask.suspendedBy, jdbcType=VARCHAR}, + #{historicTask.suspendedBy, jdbcType=NVARCHAR}, #{historicTask.endTime, jdbcType=TIMESTAMP}, - #{historicTask.completedBy, jdbcType=VARCHAR}, - #{historicTask.durationInMillis ,jdbcType=BIGINT}, - #{historicTask.deleteReason ,jdbcType=VARCHAR}, - #{historicTask.taskDefinitionKey ,jdbcType=VARCHAR}, - #{historicTask.formKey ,jdbcType=VARCHAR}, + #{historicTask.completedBy, jdbcType=NVARCHAR}, + #{historicTask.durationInMillis, jdbcType=BIGINT}, + #{historicTask.deleteReason, jdbcType=NVARCHAR}, + #{historicTask.taskDefinitionKey, jdbcType=NVARCHAR}, + #{historicTask.formKey, jdbcType=NVARCHAR}, #{historicTask.priority, jdbcType=INTEGER}, #{historicTask.inProgressStartDueDate, jdbcType=TIMESTAMP}, #{historicTask.dueDate, jdbcType=TIMESTAMP}, - #{historicTask.category, jdbcType=VARCHAR}, - #{historicTask.tenantId, jdbcType=VARCHAR}, + #{historicTask.category, jdbcType=NVARCHAR}, + #{historicTask.tenantId, jdbcType=NVARCHAR}, #{historicTask.lastUpdateTime, jdbcType=TIMESTAMP}) SELECT * FROM dual @@ -262,82 +262,82 @@ REV_ = #{revisionNext, jdbcType=INTEGER}, - TASK_DEF_ID_ = #{taskDefinitionId, jdbcType=VARCHAR}, + TASK_DEF_ID_ = #{taskDefinitionId, jdbcType=NVARCHAR}, - PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}, + PROC_DEF_ID_ = #{processDefinitionId, jdbcType=NVARCHAR}, - EXECUTION_ID_ = #{executionId, jdbcType=VARCHAR}, + EXECUTION_ID_ = #{executionId, jdbcType=NVARCHAR}, - SCOPE_ID_ = #{scopeId, jdbcType=VARCHAR}, + SCOPE_ID_ = #{scopeId, jdbcType=NVARCHAR}, - SUB_SCOPE_ID_ = #{subScopeId, jdbcType=VARCHAR}, + SUB_SCOPE_ID_ = #{subScopeId, jdbcType=NVARCHAR}, - SCOPE_TYPE_ = #{scopeType, jdbcType=VARCHAR}, + SCOPE_TYPE_ = #{scopeType, jdbcType=NVARCHAR}, - SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=VARCHAR}, + SCOPE_DEFINITION_ID_ = #{scopeDefinitionId, jdbcType=NVARCHAR}, - PROPAGATED_STAGE_INST_ID_ = #{propagatedStageInstanceId, jdbcType=VARCHAR}, + PROPAGATED_STAGE_INST_ID_ = #{propagatedStageInstanceId, jdbcType=NVARCHAR}, - STATE_ = #{state, jdbcType=VARCHAR}, + STATE_ = #{state, jdbcType=NVARCHAR}, - NAME_ = #{name, jdbcType=VARCHAR}, + NAME_ = #{name, jdbcType=NVARCHAR}, - PARENT_TASK_ID_ = #{parentTaskId, jdbcType=VARCHAR}, + PARENT_TASK_ID_ = #{parentTaskId, jdbcType=NVARCHAR}, - DESCRIPTION_ = #{description, jdbcType=VARCHAR}, + DESCRIPTION_ = #{description, jdbcType=NVARCHAR}, - OWNER_ = #{owner, jdbcType=VARCHAR}, + OWNER_ = #{owner, jdbcType=NVARCHAR}, - ASSIGNEE_ = #{assignee, jdbcType=VARCHAR}, + ASSIGNEE_ = #{assignee, jdbcType=NVARCHAR}, IN_PROGRESS_TIME_ = #{inProgressStartTime, jdbcType=TIMESTAMP}, - IN_PROGRESS_STARTED_BY_ = #{inProgressStartedBy, jdbcType=VARCHAR}, + IN_PROGRESS_STARTED_BY_ = #{inProgressStartedBy, jdbcType=NVARCHAR}, CLAIM_TIME_ = #{claimTime, jdbcType=TIMESTAMP}, - CLAIMED_BY_ = #{claimedBy, jdbcType=VARCHAR}, + CLAIMED_BY_ = #{claimedBy, jdbcType=NVARCHAR}, SUSPENDED_TIME_ = #{suspendedTime, jdbcType=TIMESTAMP}, - SUSPENDED_BY_ = #{suspendedBy, jdbcType=VARCHAR}, + SUSPENDED_BY_ = #{suspendedBy, jdbcType=NVARCHAR}, END_TIME_ = #{endTime, jdbcType=TIMESTAMP}, - COMPLETED_BY_ = #{completedBy, jdbcType=VARCHAR}, + COMPLETED_BY_ = #{completedBy, jdbcType=NVARCHAR}, - DURATION_ = #{durationInMillis ,jdbcType=BIGINT}, + DURATION_ = #{durationInMillis, jdbcType=BIGINT}, - DELETE_REASON_ = #{deleteReason ,jdbcType=VARCHAR}, + DELETE_REASON_ = #{deleteReason, jdbcType=NVARCHAR}, - TASK_DEF_KEY_ = #{taskDefinitionKey ,jdbcType=VARCHAR}, + TASK_DEF_KEY_ = #{taskDefinitionKey, jdbcType=NVARCHAR}, - FORM_KEY_ = #{formKey ,jdbcType=VARCHAR}, + FORM_KEY_ = #{formKey, jdbcType=NVARCHAR}, PRIORITY_ = #{priority, jdbcType=INTEGER}, @@ -349,26 +349,26 @@ DUE_DATE_ = #{dueDate, jdbcType=TIMESTAMP}, - CATEGORY_ = #{category, jdbcType=VARCHAR}, + CATEGORY_ = #{category, jdbcType=NVARCHAR}, LAST_UPDATED_TIME_ = #{lastUpdateTime, jdbcType=TIMESTAMP}, - where ID_ = #{id} + where ID_ = #{id, jdbcType=NVARCHAR} and REV_ = #{revision, jdbcType=INTEGER} - delete from ${prefix}ACT_HI_TASKINST where ID_ = #{id} + delete from ${prefix}ACT_HI_TASKINST where ID_ = #{id, jdbcType=NVARCHAR} delete from ${prefix}ACT_HI_TASKINST where - ID_ = #{task.id, jdbcType=VARCHAR} + ID_ = #{task.id, jdbcType=NVARCHAR} @@ -379,8 +379,8 @@ or ID_ in - - #{item} + + #{id, jdbcType=NVARCHAR} @@ -427,106 +427,106 @@ - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - + - + - - - + + + - - + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - + - + - - - + + + - - + + - - - + + + - - - - + + + + - - + + - - - + + + - - - - - - + + + + + + @@ -534,11 +534,11 @@ @@ -557,7 +557,7 @@ @@ -580,11 +580,11 @@ or SCOPE_ID_ in - - #{item} + + #{scopeId, jdbcType=NVARCHAR} ) - and SCOPE_TYPE_ = #{parameter.scopeType} + and SCOPE_TYPE_ = #{parameter.scopeType, jdbcType=NVARCHAR} - select * from ${prefix}ACT_RU_TASK where ID_ = #{id, jdbcType=VARCHAR} + select * from ${prefix}ACT_RU_TASK where ID_ = #{id, jdbcType=NVARCHAR} - select * from ${prefix}ACT_HI_VARINST where ID_ = #{variableInstanceId} + select * from ${prefix}ACT_HI_VARINST where ID_ = #{id, jdbcType=NVARCHAR} - select * from ${prefix}ACT_RU_VARIABLE where ID_ = #{id, jdbcType=VARCHAR} + select * from ${prefix}ACT_RU_VARIABLE where ID_ = #{id, jdbcType=NVARCHAR}