提交 587b501c 编写于 作者: T tombaeyens

ACT-247 cleaning unused columns

上级 7979d8da
......@@ -19,7 +19,6 @@ import java.util.Map;
import org.activiti.engine.impl.db.DbSqlSession;
import org.activiti.engine.impl.db.PersistentObject;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.task.TaskEntity;
import org.activiti.engine.impl.variable.ValueFields;
import org.activiti.engine.impl.variable.VariableType;
......@@ -37,7 +36,6 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Se
protected String processInstanceId;
protected String executionId;
protected String taskId;
protected Long longValue;
protected Double doubleValue;
......@@ -80,14 +78,6 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Se
this.processInstanceId = execution.getProcessInstanceId();
}
public void setTask(TaskEntity task) {
if (task != null) {
this.taskId = task.getId();
} else {
this.taskId = null;
}
}
public void delete() {
// delete variable
DbSqlSession dbSqlSession = CommandContext
......@@ -140,12 +130,10 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Se
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
public void setExecutionId(String executionId) {
this.executionId = executionId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public void setByteArrayValueId(String byteArrayValueId) {
this.byteArrayValueId = byteArrayValueId;
......@@ -193,9 +181,6 @@ public class VariableInstanceEntity implements ValueFields, PersistentObject, Se
public String getExecutionId() {
return executionId;
}
public String getTaskId() {
return taskId;
}
public Long getLongValue() {
return longValue;
}
......
......@@ -127,12 +127,10 @@ create table ACT_RU_VARIABLE (
NAME_ varchar(255) not null,
EXECUTION_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
TASK_ID_ varchar(64),
BYTEARRAY_ID_ varchar(64),
DATE_ timestamp,
DOUBLE_ double,
LONG_ bigint,
TEXT1_ varchar(255),
TEXT_ varchar(255),
TEXT2_ varchar(255),
primary key (ID_)
);
......@@ -178,10 +176,9 @@ create table ACT_HI_DETAIL (
REV_ integer,
TIME_ timestamp not null,
BYTEARRAY_ID_ varchar(64),
DATE_ timestamp,
DOUBLE_ double,
LONG_ bigint,
TEXT1_ varchar(255),
TEXT_ varchar(255),
TEXT2_ varchar(255),
primary key (ID_)
);
......@@ -257,11 +254,6 @@ alter table ACT_RU_TASK
foreign key (PROC_DEF_ID_)
references ACT_RE_PROC_DEF;
alter table ACT_RU_VARIABLE
add constraint FK_VAR_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK;
alter table ACT_RU_VARIABLE
add constraint FK_VAR_EXE
foreign key (EXECUTION_ID_)
......
......@@ -130,10 +130,9 @@ create table ACT_RU_VARIABLE (
PROC_INST_ID_ varchar(64),
TASK_ID_ varchar(64),
BYTEARRAY_ID_ varchar(64),
DATE_ timestamp,
DOUBLE_ double,
LONG_ bigint,
TEXT1_ varchar(255),
TEXT_ varchar(255),
TEXT2_ varchar(255),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -180,10 +179,9 @@ create table ACT_HI_DETAIL (
REV_ integer,
TIME_ datetime not null,
BYTEARRAY_ID_ varchar(64),
DATE_ datetime,
DOUBLE_ double,
LONG_ bigint,
TEXT1_ varchar(255),
TEXT_ varchar(255),
TEXT2_ varchar(255),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -251,11 +249,6 @@ alter table ACT_RU_TASK
foreign key (PROC_DEF_ID_)
references ACT_RE_PROC_DEF (ID_);
alter table ACT_RU_VARIABLE
add constraint FK_VAR_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
alter table ACT_RU_VARIABLE
add constraint FK_VAR_EXE
foreign key (EXECUTION_ID_)
......
......@@ -129,10 +129,9 @@ create table ACT_RU_VARIABLE (
PROC_INST_ID_ NVARCHAR2(64),
TASK_ID_ NVARCHAR2(64),
BYTEARRAY_ID_ NVARCHAR2(64),
DATE_ TIMESTAMP(6),
DOUBLE_ NUMBER(*,10),
LONG_ NUMBER(19,0),
TEXT1_ NVARCHAR2(255),
TEXT_ NVARCHAR2(255),
TEXT2_ NVARCHAR2(255),
primary key (ID_)
);
......@@ -178,10 +177,9 @@ create table ACT_HI_DETAIL (
REV_ INTEGER,
TIME_ TIMESTAMP(6) not null,
BYTEARRAY_ID_ NVARCHAR2(64),
DATE_ TIMESTAMP(6),
DOUBLE_ NUMBER(*,10),
LONG_ NUMBER(19,0),
TEXT1_ NVARCHAR2(255),
TEXT_ NVARCHAR2(255),
TEXT2_ NVARCHAR2(255),
primary key (ID_)
);
......@@ -259,12 +257,6 @@ alter table ACT_RU_TASK
foreign key (PROC_DEF_ID_)
references ACT_RE_PROC_DEF (ID_);
create index ACT_IDX_VAR_TASK on ACT_RU_VARIABLE(TASK_ID_);
alter table ACT_RU_VARIABLE
add constraint FK_VAR_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
create index ACT_IDX_VAR_EXE on ACT_RU_VARIABLE(EXECUTION_ID_);
alter table ACT_RU_VARIABLE
add constraint FK_VAR_EXE
......
......@@ -130,10 +130,9 @@ create table ACT_RU_VARIABLE (
PROC_INST_ID_ varchar(64),
TASK_ID_ varchar(64),
BYTEARRAY_ID_ varchar(64),
DATE_ timestamp,
DOUBLE_ double precision,
LONG_ bigint,
TEXT1_ varchar(255),
TEXT_ varchar(255),
TEXT2_ varchar(255),
primary key (ID_)
);
......@@ -180,10 +179,9 @@ create table ACT_HI_DETAIL (
REV_ integer,
TIME_ timestamp not null,
BYTEARRAY_ID_ varchar(64),
DATE_ timestamp,
DOUBLE_ double precision,
LONG_ bigint,
TEXT1_ varchar(255),
TEXT_ varchar(255),
TEXT2_ varchar(255),
primary key (ID_)
);
......@@ -261,12 +259,6 @@ alter table ACT_RU_TASK
foreign key (PROC_DEF_ID_)
references ACT_RE_PROC_DEF (ID_);
create index ACT_IDX_VAR_TASK on ACT_RU_VARIABLE(TASK_ID_);
alter table ACT_RU_VARIABLE
add constraint FK_VAR_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
create index ACT_IDX_VAR_EXE on ACT_RU_VARIABLE(EXECUTION_ID_);
alter table ACT_RU_VARIABLE
add constraint FK_VAR_EXE
......
......@@ -50,9 +50,6 @@ alter table ACT_RU_TASK
alter table ACT_RU_VARIABLE
drop constraint FK_VAR_EXE;
alter table ACT_RU_VARIABLE
drop constraint FK_VAR_TASK;
alter table ACT_RU_VARIABLE
drop constraint FK_VAR_PROCINST;
......
......@@ -45,9 +45,6 @@ alter table ACT_RU_TASK
alter table ACT_RU_VARIABLE
drop FOREIGN KEY FK_VAR_EXE;
alter table ACT_RU_VARIABLE
drop FOREIGN KEY FK_VAR_TASK;
alter table ACT_RU_VARIABLE
drop FOREIGN KEY FK_VAR_PROCINST;
......
......@@ -60,9 +60,6 @@ alter table ACT_RU_TASK
alter table ACT_RU_VARIABLE
drop CONSTRAINT FK_VAR_EXE;
alter table ACT_RU_VARIABLE
drop CONSTRAINT FK_VAR_TASK;
alter table ACT_RU_VARIABLE
drop CONSTRAINT FK_VAR_PROCINST;
......
......@@ -60,9 +60,6 @@ alter table ACT_RU_TASK
alter table ACT_RU_VARIABLE
drop constraint FK_VAR_EXE;
alter table ACT_RU_VARIABLE
drop constraint FK_VAR_TASK;
alter table ACT_RU_VARIABLE
drop constraint FK_VAR_PROCINST;
......
......@@ -230,7 +230,7 @@
<!-- HISTORIC DETAILS INSERT -->
<insert id="insertHistoricFormProperty" parameterType="org.activiti.engine.impl.history.HistoricFormPropertyEntity">
insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TIME_, NAME_, TEXT1_)
insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TIME_, NAME_, TEXT_)
values (
#{id, jdbcType=VARCHAR},
'FormProperty',
......@@ -244,7 +244,7 @@
</insert>
<insert id="insertHistoricVariableUpdate" parameterType="org.activiti.engine.impl.history.HistoricVariableUpdateEntity">
insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, NAME_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT1_, TEXT2_)
insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, NAME_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_)
values (
#{id, jdbcType=VARCHAR},
'VariableUpdate',
......@@ -288,14 +288,14 @@
<result property="activityId" column="ACTIVITY_ID_" jdbcType="VARCHAR" />
<result property="byteArrayValueId" column="BYTEARRAY_ID_" jdbcType="VARCHAR" />
<result property="doubleValue" column="DOUBLE_" jdbcType="DOUBLE" />
<result property="textValue" column="TEXT1_" jdbcType="VARCHAR" />
<result property="textValue" column="TEXT_" jdbcType="VARCHAR" />
<result property="textValue2" column="TEXT2_" jdbcType="VARCHAR" />
<result property="longValue" column="LONG_" jdbcType="BIGINT" />
</resultMap>
<resultMap id="historicFormPropertyResultMap" extends="historicDetailResultMap" type="org.activiti.engine.impl.history.HistoricFormPropertyEntity">
<result property="propertyId" column="NAME_" javaType="String" jdbcType="VARCHAR" />
<result property="propertyValue" column="TEXT1_" javaType="String" jdbcType="VARCHAR"/>
<result property="propertyValue" column="TEXT_" javaType="String" jdbcType="VARCHAR"/>
</resultMap>
<!-- HISTORIC VARIABLE UPDATE SELECT -->
......
......@@ -138,7 +138,7 @@
<foreach item="var" collection="variables" index="index">
and A${index}.NAME_= #{var.name}
<if test="var.textValue != null &amp;&amp; var.longValue == null &amp;&amp; var.doubleValue == null">
and A${index}.TEXT1_
and A${index}.TEXT_
<choose>
<when test="var.operator.equals('LIKE')">LIKE</when>
<otherwise><include refid="executionVariableOperator" /></otherwise>
......@@ -167,10 +167,10 @@
<if test="var.textValue == null &amp;&amp; var.longValue == null &amp;&amp; var.doubleValue == null">
<choose>
<when test="var.operator.equals('NOT_EQUALS')">
and (A${index}.TEXT1_ is not null or A${index}.TEXT2_ is not null or A${index}.LONG_ is not null or A${index}.DOUBLE_ is not null or A${index}.BYTEARRAY_ID_ is not null)
and (A${index}.TEXT_ is not null or A${index}.TEXT2_ is not null or A${index}.LONG_ is not null or A${index}.DOUBLE_ is not null or A${index}.BYTEARRAY_ID_ is not null)
</when>
<otherwise>
and A${index}.TEXT1_ is null and A${index}.TEXT2_ is null and A${index}.LONG_ is null and A${index}.DOUBLE_ is null and A${index}.BYTEARRAY_ID_ is null
and A${index}.TEXT_ is null and A${index}.TEXT2_ is null and A${index}.LONG_ is null and A${index}.DOUBLE_ is null and A${index}.BYTEARRAY_ID_ is null
</otherwise>
</choose>
</if>
......
......@@ -7,7 +7,7 @@
<!-- VARIABLE INSTANCE INSERT -->
<insert id="insertVariableInstance" parameterType="org.activiti.engine.impl.runtime.VariableInstanceEntity">
insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT1_, TEXT2_)
insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_)
values (
#{id, jdbcType=VARCHAR},
1,
......@@ -15,7 +15,6 @@
#{name, jdbcType=VARCHAR},
#{processInstanceId, jdbcType=VARCHAR},
#{executionId, jdbcType=VARCHAR},
#{taskId, jdbcType=VARCHAR},
#{byteArrayValueId, jdbcType=VARCHAR},
#{doubleValue, jdbcType=DOUBLE},
#{longValue, jdbcType=BIGINT},
......@@ -33,7 +32,7 @@
BYTEARRAY_ID_ = #{byteArrayValueId, jdbcType=VARCHAR},
DOUBLE_ = #{doubleValue, jdbcType=DOUBLE},
LONG_ = #{longValue, jdbcType=BIGINT},
TEXT1_ = #{textValue, jdbcType=VARCHAR},
TEXT_ = #{textValue, jdbcType=VARCHAR},
TEXT2_ = #{textValue2, jdbcType=VARCHAR}
where ID_ = #{id, jdbcType=VARCHAR}
and REV_ = #{revision, jdbcType=INTEGER}
......@@ -59,7 +58,7 @@
<result property="isConcurrencyScope" column="IS_CONCURRENCY_SCOPE_" jdbcType="BOOLEAN" />
<result property="byteArrayValueId" column="BYTEARRAY_ID_" jdbcType="VARCHAR" />
<result property="doubleValue" column="DOUBLE_" jdbcType="DOUBLE" />
<result property="textValue" column="TEXT1_" jdbcType="VARCHAR"/>
<result property="textValue" column="TEXT_" jdbcType="VARCHAR"/>
<result property="textValue2" column="TEXT2_" jdbcType="VARCHAR"/>
<result property="longValue" column="LONG_" jdbcType="BIGINT"/>
</resultMap>
......@@ -77,12 +76,6 @@
jdbcType=VARCHAR}
</select>
<select id="selectVariablesByTaskId" parameterType="string" resultMap="variableInstanceResultMap">
select * from ACT_RU_VARIABLE where TASK_ID_
= #{executionId, jdbcType=VARCHAR}
</select>
<!-- BYTE ARRAY INSERT -->
<insert id="insertByteArray" parameterType="org.activiti.engine.impl.runtime.ByteArrayEntity">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册