TSK-1507: Cleaned up some CodeSmells (#1400)

* TSK-1507: Cleaned up some CodeSmells

* TSK-1507: Improvements after review
This commit is contained in:
tge20 2021-02-03 12:33:16 +01:00 committed by GitHub
parent 9906c0c7f9
commit ff0b77f6ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 770 additions and 921 deletions

View File

@ -95,15 +95,15 @@ public interface BaseQuery<T, U extends Enum<U> & QueryColumnName> {
ASCENDING("ASC"), ASCENDING("ASC"),
DESCENDING("DESC"); DESCENDING("DESC");
private final String sortDirection; private final String direction;
SortDirection(String sortDirection) { SortDirection(String sortDirection) {
this.sortDirection = sortDirection; this.direction = sortDirection;
} }
@Override @Override
public String toString() { public String toString() {
return sortDirection; return direction;
} }
} }
} }

View File

@ -3,7 +3,6 @@ package pro.taskana.simplehistory.impl.classification;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent; import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
@ -36,32 +35,29 @@ public interface ClassificationHistoryEventMapper {
+ " FROM CLASSIFICATION_HISTORY_EVENT WHERE ID = #{id} " + " FROM CLASSIFICATION_HISTORY_EVENT WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "eventType", column = "EVENT_TYPE")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "eventType", column = "EVENT_TYPE"), @Result(property = "userId", column = "USER_ID")
@Result(property = "created", column = "CREATED"), @Result(property = "classificationId", column = "CLASSIFICATION_ID")
@Result(property = "userId", column = "USER_ID"), @Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT")
@Result(property = "classificationId", column = "CLASSIFICATION_ID"), @Result(property = "category", column = "CATEGORY")
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "category", column = "CATEGORY"), @Result(property = "key", column = "KEY")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "name", column = "NAME")
@Result(property = "key", column = "KEY"), @Result(property = "parentId", column = "PARENT_ID")
@Result(property = "name", column = "NAME"), @Result(property = "parentKey", column = "PARENT_KEY")
@Result(property = "parentId", column = "PARENT_ID"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "parentKey", column = "PARENT_KEY"), @Result(property = "serviceLevel", column = "SERVICE_LEVEL")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "type", column = "TYPE")
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "type", column = "TYPE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "details", column = "DETAILS")
@Result(property = "custom8", column = "CUSTOM_8"),
@Result(property = "details", column = "DETAILS")
})
ClassificationHistoryEvent findById(@Param("id") String id); ClassificationHistoryEvent findById(@Param("id") String id);
} }

View File

@ -2,7 +2,6 @@ package pro.taskana.simplehistory.impl.classification;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.simplehistory.impl.ClassificationHistoryQueryImpl; import pro.taskana.simplehistory.impl.ClassificationHistoryQueryImpl;
@ -66,32 +65,29 @@ public interface ClassificationHistoryQueryMapper {
+ "</where>" + "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> " + "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "eventType", column = "EVENT_TYPE")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "eventType", column = "EVENT_TYPE"), @Result(property = "userId", column = "USER_ID")
@Result(property = "created", column = "CREATED"), @Result(property = "classificationId", column = "CLASSIFICATION_ID")
@Result(property = "userId", column = "USER_ID"), @Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT")
@Result(property = "classificationId", column = "CLASSIFICATION_ID"), @Result(property = "category", column = "CATEGORY")
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "category", column = "CATEGORY"), @Result(property = "key", column = "KEY")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "name", column = "NAME")
@Result(property = "key", column = "KEY"), @Result(property = "parentId", column = "PARENT_ID")
@Result(property = "name", column = "NAME"), @Result(property = "parentKey", column = "PARENT_KEY")
@Result(property = "parentId", column = "PARENT_ID"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "parentKey", column = "PARENT_KEY"), @Result(property = "serviceLevel", column = "SERVICE_LEVEL")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "type", column = "TYPE")
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "type", column = "TYPE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom7", column = "CUSTOM_7"),
@Result(property = "custom8", column = "CUSTOM_8")
})
List<ClassificationHistoryEvent> queryHistoryEvents( List<ClassificationHistoryEvent> queryHistoryEvents(
ClassificationHistoryQueryImpl historyEventQuery); ClassificationHistoryQueryImpl historyEventQuery);

View File

@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent; import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
@ -37,33 +36,30 @@ public interface TaskHistoryEventMapper {
+ "FROM TASK_HISTORY_EVENT WHERE ID = #{id} " + "FROM TASK_HISTORY_EVENT WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID")
@Result(property = "id", column = "ID"), @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID")
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), @Result(property = "taskId", column = "TASK_ID")
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), @Result(property = "eventType", column = "EVENT_TYPE")
@Result(property = "taskId", column = "TASK_ID"), @Result(property = "created", column = "CREATED")
@Result(property = "eventType", column = "EVENT_TYPE"), @Result(property = "userId", column = "USER_ID")
@Result(property = "created", column = "CREATED"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "userId", column = "USER_ID"), @Result(property = "workbasketKey", column = "WORKBASKET_KEY")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "porCompany", column = "POR_COMPANY")
@Result(property = "workbasketKey", column = "WORKBASKET_KEY"), @Result(property = "porSystem", column = "POR_SYSTEM")
@Result(property = "porCompany", column = "POR_COMPANY"), @Result(property = "porInstance", column = "POR_INSTANCE")
@Result(property = "porSystem", column = "POR_SYSTEM"), @Result(property = "porType", column = "POR_TYPE")
@Result(property = "porInstance", column = "POR_INSTANCE"), @Result(property = "porValue", column = "POR_VALUE")
@Result(property = "porType", column = "POR_TYPE"), @Result(property = "taskClassificationKey", column = "TASK_CLASSIFICATION_KEY")
@Result(property = "porValue", column = "POR_VALUE"), @Result(property = "taskClassificationCategory", column = "TASK_CLASSIFICATION_CATEGORY")
@Result(property = "taskClassificationKey", column = "TASK_CLASSIFICATION_KEY"), @Result(property = "attachmentClassificationKey", column = "ATTACHMENT_CLASSIFICATION_KEY")
@Result(property = "taskClassificationCategory", column = "TASK_CLASSIFICATION_CATEGORY"), @Result(property = "oldValue", column = "OLD_VALUE")
@Result(property = "attachmentClassificationKey", column = "ATTACHMENT_CLASSIFICATION_KEY"), @Result(property = "newValue", column = "NEW_VALUE")
@Result(property = "oldValue", column = "OLD_VALUE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "newValue", column = "NEW_VALUE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "details", column = "DETAILS")
@Result(property = "custom4", column = "CUSTOM_4"),
@Result(property = "details", column = "DETAILS")
})
TaskHistoryEvent findById(@Param("id") String id); TaskHistoryEvent findById(@Param("id") String id);
@Delete( @Delete(

View File

@ -2,7 +2,6 @@ package pro.taskana.simplehistory.impl.task;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.simplehistory.impl.TaskHistoryQueryImpl; import pro.taskana.simplehistory.impl.TaskHistoryQueryImpl;
@ -68,32 +67,29 @@ public interface TaskHistoryQueryMapper {
+ "</where>" + "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> " + "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID")
@Result(property = "id", column = "ID"), @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID")
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), @Result(property = "taskId", column = "TASK_ID")
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), @Result(property = "eventType", column = "EVENT_TYPE")
@Result(property = "taskId", column = "TASK_ID"), @Result(property = "created", column = "CREATED")
@Result(property = "eventType", column = "EVENT_TYPE"), @Result(property = "userId", column = "USER_ID")
@Result(property = "created", column = "CREATED"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "userId", column = "USER_ID"), @Result(property = "workbasketKey", column = "WORKBASKET_KEY")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "porCompany", column = "POR_COMPANY")
@Result(property = "workbasketKey", column = "WORKBASKET_KEY"), @Result(property = "porSystem", column = "POR_SYSTEM")
@Result(property = "porCompany", column = "POR_COMPANY"), @Result(property = "porInstance", column = "POR_INSTANCE")
@Result(property = "porSystem", column = "POR_SYSTEM"), @Result(property = "porType", column = "POR_TYPE")
@Result(property = "porInstance", column = "POR_INSTANCE"), @Result(property = "porValue", column = "POR_VALUE")
@Result(property = "porType", column = "POR_TYPE"), @Result(property = "taskClassificationKey", column = "TASK_CLASSIFICATION_KEY")
@Result(property = "porValue", column = "POR_VALUE"), @Result(property = "taskClassificationCategory", column = "TASK_CLASSIFICATION_CATEGORY")
@Result(property = "taskClassificationKey", column = "TASK_CLASSIFICATION_KEY"), @Result(property = "attachmentClassificationKey", column = "ATTACHMENT_CLASSIFICATION_KEY")
@Result(property = "taskClassificationCategory", column = "TASK_CLASSIFICATION_CATEGORY"), @Result(property = "oldValue", column = "OLD_VALUE")
@Result(property = "attachmentClassificationKey", column = "ATTACHMENT_CLASSIFICATION_KEY"), @Result(property = "newValue", column = "NEW_VALUE")
@Result(property = "oldValue", column = "OLD_VALUE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "newValue", column = "NEW_VALUE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"),
@Result(property = "custom4", column = "CUSTOM_4")
})
List<TaskHistoryEvent> queryHistoryEvents(TaskHistoryQueryImpl historyEventQuery); List<TaskHistoryEvent> queryHistoryEvents(TaskHistoryQueryImpl historyEventQuery);
@Select( @Select(

View File

@ -3,7 +3,6 @@ package pro.taskana.simplehistory.impl.workbasket;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent; import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
@ -34,26 +33,23 @@ public interface WorkbasketHistoryEventMapper {
+ "FROM WORKBASKET_HISTORY_EVENT WHERE ID = #{id} " + "FROM WORKBASKET_HISTORY_EVENT WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "id", column = "ID"), @Result(property = "eventType", column = "EVENT_TYPE")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "created", column = "CREATED")
@Result(property = "eventType", column = "EVENT_TYPE"), @Result(property = "userId", column = "USER_ID")
@Result(property = "created", column = "CREATED"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "userId", column = "USER_ID"), @Result(property = "key", column = "KEY")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "type", column = "TYPE")
@Result(property = "key", column = "KEY"), @Result(property = "owner", column = "OWNER")
@Result(property = "type", column = "TYPE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "owner", column = "OWNER"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORGLEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORGLEVEL_2")
@Result(property = "orgLevel1", column = "ORGLEVEL_1"), @Result(property = "orgLevel3", column = "ORGLEVEL_3")
@Result(property = "orgLevel2", column = "ORGLEVEL_2"), @Result(property = "orgLevel4", column = "ORGLEVEL_4")
@Result(property = "orgLevel3", column = "ORGLEVEL_3"), @Result(property = "details", column = "DETAILS")
@Result(property = "orgLevel4", column = "ORGLEVEL_4"),
@Result(property = "details", column = "DETAILS")
})
WorkbasketHistoryEvent findById(@Param("id") String id); WorkbasketHistoryEvent findById(@Param("id") String id);
} }

View File

@ -2,7 +2,6 @@ package pro.taskana.simplehistory.impl.workbasket;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.simplehistory.impl.WorkbasketHistoryQueryImpl; import pro.taskana.simplehistory.impl.WorkbasketHistoryQueryImpl;
@ -55,26 +54,23 @@ public interface WorkbasketHistoryQueryMapper {
+ "</where>" + "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> " + "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "id", column = "ID"), @Result(property = "eventType", column = "EVENT_TYPE")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "created", column = "CREATED")
@Result(property = "eventType", column = "EVENT_TYPE"), @Result(property = "userId", column = "USER_ID")
@Result(property = "created", column = "CREATED"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "userId", column = "USER_ID"), @Result(property = "key", column = "KEY")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "type", column = "TYPE")
@Result(property = "key", column = "KEY"), @Result(property = "owner", column = "OWNER")
@Result(property = "type", column = "TYPE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "owner", column = "OWNER"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORGLEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORGLEVEL_2")
@Result(property = "orgLevel1", column = "ORGLEVEL_1"), @Result(property = "orgLevel3", column = "ORGLEVEL_3")
@Result(property = "orgLevel2", column = "ORGLEVEL_2"), @Result(property = "orgLevel4", column = "ORGLEVEL_4")
@Result(property = "orgLevel3", column = "ORGLEVEL_3"),
@Result(property = "orgLevel4", column = "ORGLEVEL_4")
})
List<WorkbasketHistoryEvent> queryHistoryEvents(WorkbasketHistoryQueryImpl historyEventQuery); List<WorkbasketHistoryEvent> queryHistoryEvents(WorkbasketHistoryQueryImpl historyEventQuery);
@Select( @Select(

View File

@ -49,7 +49,7 @@ public class TaskanaProducers {
dataSource = (DataSource) ctx.lookup(properties.getProperty("datasource.jndi")); dataSource = (DataSource) ctx.lookup(properties.getProperty("datasource.jndi"));
try (Connection connection = dataSource.getConnection()) { try (Connection connection = dataSource.getConnection()) {
DatabaseMetaData metaData = connection.getMetaData(); DatabaseMetaData metaData = connection.getMetaData();
LOGGER.debug("---------------> " + metaData); LOGGER.debug("---------------> {}", metaData);
} }
this.taskanaEngineConfiguration = this.taskanaEngineConfiguration =
new TaskanaEngineConfiguration(dataSource, true, false, "TASKANA"); new TaskanaEngineConfiguration(dataSource, true, false, "TASKANA");

View File

@ -4,7 +4,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -21,31 +20,29 @@ public interface ClassificationMapper {
+ "AND DOMAIN = #{domain}" + "AND DOMAIN = #{domain}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "key", column = "KEY")
@Result(property = "key", column = "KEY"), @Result(property = "parentId", column = "PARENT_ID")
@Result(property = "parentId", column = "PARENT_ID"), @Result(property = "parentKey", column = "PARENT_KEY")
@Result(property = "parentKey", column = "PARENT_KEY"), @Result(property = "category", column = "CATEGORY")
@Result(property = "category", column = "CATEGORY"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "isValidInDomain", column = "VALID_IN_DOMAIN")
@Result(property = "isValidInDomain", column = "VALID_IN_DOMAIN"), @Result(property = "created", column = "CREATED")
@Result(property = "created", column = "CREATED"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "name", column = "NAME")
@Result(property = "name", column = "NAME"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "serviceLevel", column = "SERVICE_LEVEL")
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"), @Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT")
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom8", column = "CUSTOM_8")
})
ClassificationImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain); ClassificationImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain);
@Select( @Select(
@ -54,31 +51,29 @@ public interface ClassificationMapper {
+ "WHERE ID = #{id}" + "WHERE ID = #{id}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "key", column = "KEY")
@Result(property = "key", column = "KEY"), @Result(property = "parentId", column = "PARENT_ID")
@Result(property = "parentId", column = "PARENT_ID"), @Result(property = "parentKey", column = "PARENT_KEY")
@Result(property = "parentKey", column = "PARENT_KEY"), @Result(property = "category", column = "CATEGORY")
@Result(property = "category", column = "CATEGORY"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "isValidInDomain", column = "VALID_IN_DOMAIN")
@Result(property = "isValidInDomain", column = "VALID_IN_DOMAIN"), @Result(property = "created", column = "CREATED")
@Result(property = "created", column = "CREATED"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "name", column = "NAME")
@Result(property = "name", column = "NAME"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "serviceLevel", column = "SERVICE_LEVEL")
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"), @Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT")
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom8", column = "CUSTOM_8")
})
ClassificationImpl findById(@Param("id") String id); ClassificationImpl findById(@Param("id") String id);
@Insert( @Insert(

View File

@ -2,7 +2,6 @@ package pro.taskana.classification.internal;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.classification.internal.models.ClassificationSummaryImpl; import pro.taskana.classification.internal.models.ClassificationSummaryImpl;
@ -52,27 +51,25 @@ public interface ClassificationQueryMapper {
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> " + "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "key", column = "KEY")
@Result(property = "key", column = "KEY"), @Result(property = "category", column = "CATEGORY")
@Result(property = "category", column = "CATEGORY"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "name", column = "NAME")
@Result(property = "name", column = "NAME"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "serviceLevel", column = "SERVICE_LEVEL")
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"), @Result(property = "parentId", column = "PARENT_ID")
@Result(property = "parentId", column = "PARENT_ID"), @Result(property = "parentKey", column = "PARENT_KEY")
@Result(property = "parentKey", column = "PARENT_KEY"), @Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT")
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom8", column = "CUSTOM_8")
})
List<ClassificationSummaryImpl> queryClassificationSummaries( List<ClassificationSummaryImpl> queryClassificationSummaries(
ClassificationQueryImpl classificationQuery); ClassificationQueryImpl classificationQuery);

View File

@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -33,7 +32,7 @@ public interface JobMapper {
+ "</choose>" + "</choose>"
+ ", #{job.priority}, #{job.created}, #{job.due}, #{job.state}, #{job.lockedBy}, #{job.lockExpires}, #{job.type}, #{job.retryCount}, #{job.arguments,javaType=java.util.Map,typeHandler=pro.taskana.common.internal.persistence.MapTypeHandler} )" + ", #{job.priority}, #{job.created}, #{job.due}, #{job.state}, #{job.lockedBy}, #{job.lockExpires}, #{job.type}, #{job.retryCount}, #{job.arguments,javaType=java.util.Map,typeHandler=pro.taskana.common.internal.persistence.MapTypeHandler} )"
+ "</script>") + "</script>")
@Results(value = {@Result(property = "jobId", column = "JOB_ID")}) @Result(property = "jobId", column = "JOB_ID")
Integer insertJob(@Param("job") ScheduledJob job); Integer insertJob(@Param("job") ScheduledJob job);
@Select( @Select(
@ -43,23 +42,20 @@ public interface JobMapper {
+ "ORDER BY PRIORITY DESC " + "ORDER BY PRIORITY DESC "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "jobId", column = "JOB_ID")
value = { @Result(property = "priority", column = "PRIORITY")
@Result(property = "jobId", column = "JOB_ID"), @Result(property = "created", column = "CREATED")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "due", column = "DUE")
@Result(property = "created", column = "CREATED"), @Result(property = "state", column = "STATE")
@Result(property = "due", column = "DUE"), @Result(property = "lockedBy", column = "LOCKED_BY")
@Result(property = "state", column = "STATE"), @Result(property = "lockExpires", column = "LOCK_EXPIRES")
@Result(property = "lockedBy", column = "LOCKED_BY"), @Result(property = "type", column = "TYPE")
@Result(property = "lockExpires", column = "LOCK_EXPIRES"), @Result(property = "retryCount", column = "RETRY_COUNT")
@Result(property = "type", column = "TYPE"), @Result(
@Result(property = "retryCount", column = "RETRY_COUNT"), property = "arguments",
@Result( column = "ARGUMENTS",
property = "arguments", javaType = Map.class,
column = "ARGUMENTS", typeHandler = MapTypeHandler.class)
javaType = Map.class,
typeHandler = MapTypeHandler.class)
})
List<ScheduledJob> findJobsToRun(Instant now); List<ScheduledJob> findJobsToRun(Instant now);
@Update( @Update(

View File

@ -4,7 +4,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.monitor.api.CombinedClassificationFilter; import pro.taskana.monitor.api.CombinedClassificationFilter;
@ -112,11 +111,9 @@ public interface MonitorMapper {
+ ") AS B " + ") AS B "
+ "GROUP BY B.CLASSIFICATION_CATEGORY, B.AGE_IN_DAYS " + "GROUP BY B.CLASSIFICATION_CATEGORY, B.AGE_IN_DAYS "
+ "</script>") + "</script>")
@Results({ @Result(column = "CLASSIFICATION_CATEGORY", property = "key")
@Result(column = "CLASSIFICATION_CATEGORY", property = "key"), @Result(column = "AGE_IN_DAYS", property = "ageInDays")
@Result(column = "AGE_IN_DAYS", property = "ageInDays"), @Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
})
List<MonitorQueryItem> getTaskCountOfCategories( List<MonitorQueryItem> getTaskCountOfCategories(
@Param("workbasketIds") List<String> workbasketIds, @Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states, @Param("states") List<TaskState> states,
@ -161,11 +158,9 @@ public interface MonitorMapper {
+ ") AS B " + ") AS B "
+ "GROUP BY B.CLASSIFICATION_KEY, B.AGE_IN_DAYS " + "GROUP BY B.CLASSIFICATION_KEY, B.AGE_IN_DAYS "
+ "</script>") + "</script>")
@Results({ @Result(column = "CLASSIFICATION_KEY", property = "key")
@Result(column = "CLASSIFICATION_KEY", property = "key"), @Result(column = "AGE_IN_DAYS", property = "ageInDays")
@Result(column = "AGE_IN_DAYS", property = "ageInDays"), @Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
})
List<MonitorQueryItem> getTaskCountOfClassifications( List<MonitorQueryItem> getTaskCountOfClassifications(
@Param("workbasketIds") List<String> workbasketIds, @Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states, @Param("states") List<TaskState> states,
@ -210,12 +205,10 @@ public interface MonitorMapper {
+ ") AS B " + ") AS B "
+ "GROUP BY B.TASK_CLASSIFICATION_KEY, B.ATTACHMENT_CLASSIFICATION_KEY, B.AGE_IN_DAYS " + "GROUP BY B.TASK_CLASSIFICATION_KEY, B.ATTACHMENT_CLASSIFICATION_KEY, B.AGE_IN_DAYS "
+ "</script>") + "</script>")
@Results({ @Result(column = "TASK_CLASSIFICATION_KEY", property = "key")
@Result(column = "TASK_CLASSIFICATION_KEY", property = "key"), @Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey")
@Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey"), @Result(column = "AGE_IN_DAYS", property = "ageInDays")
@Result(column = "AGE_IN_DAYS", property = "ageInDays"), @Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
})
List<DetailedMonitorQueryItem> getTaskCountOfDetailedClassifications( List<DetailedMonitorQueryItem> getTaskCountOfDetailedClassifications(
@Param("workbasketIds") List<String> workbasketIds, @Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states, @Param("states") List<TaskState> states,
@ -260,11 +253,9 @@ public interface MonitorMapper {
+ ") AS B " + ") AS B "
+ "GROUP BY B.CUSTOM_FIELD, B.AGE_IN_DAYS " + "GROUP BY B.CUSTOM_FIELD, B.AGE_IN_DAYS "
+ "</script>") + "</script>")
@Results({ @Result(column = "CUSTOM_FIELD", property = "key")
@Result(column = "CUSTOM_FIELD", property = "key"), @Result(column = "AGE_IN_DAYS", property = "ageInDays")
@Result(column = "AGE_IN_DAYS", property = "ageInDays"), @Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")
})
List<MonitorQueryItem> getTaskCountOfTaskCustomFieldValues( List<MonitorQueryItem> getTaskCountOfTaskCustomFieldValues(
@Param("customField") TaskCustomField taskCustomField, @Param("customField") TaskCustomField taskCustomField,
@Param("workbasketIds") List<String> workbasketIds, @Param("workbasketIds") List<String> workbasketIds,
@ -368,11 +359,9 @@ public interface MonitorMapper {
+ "</where>" + "</where>"
+ "GROUP BY WORKBASKET_KEY, STATE" + "GROUP BY WORKBASKET_KEY, STATE"
+ "</script>") + "</script>")
@Results({ @Result(column = "WORKBASKET_KEY", property = "workbasketKey")
@Result(column = "WORKBASKET_KEY", property = "workbasketKey"), @Result(column = "STATE", property = "state")
@Result(column = "STATE", property = "state"), @Result(column = "COUNT", property = "count")
@Result(column = "COUNT", property = "count"),
})
List<TaskQueryItem> getTasksCountByState( List<TaskQueryItem> getTasksCountByState(
@Param("domains") List<String> domains, @Param("domains") List<String> domains,
@Param("states") List<TaskState> states, @Param("states") List<TaskState> states,
@ -468,15 +457,13 @@ public interface MonitorMapper {
+ ") AS A " + ") AS A "
+ "GROUP BY A.AGE_IN_DAYS, A.ORG_LEVEL_1, A.ORG_LEVEL_2, A.ORG_LEVEL_3, A.ORG_LEVEL_4 " + "GROUP BY A.AGE_IN_DAYS, A.ORG_LEVEL_1, A.ORG_LEVEL_2, A.ORG_LEVEL_3, A.ORG_LEVEL_4 "
+ "</script>") + "</script>")
@Results({ @Result(column = "STATUS", property = "status")
@Result(column = "STATUS", property = "status"), @Result(column = "AGE_IN_DAYS", property = "ageInDays")
@Result(column = "AGE_IN_DAYS", property = "ageInDays"), @Result(column = "COUNT", property = "count")
@Result(column = "COUNT", property = "count"), @Result(column = "ORG_LEVEL_1", property = "orgLevel1")
@Result(column = "ORG_LEVEL_1", property = "orgLevel1"), @Result(column = "ORG_LEVEL_2", property = "orgLevel2")
@Result(column = "ORG_LEVEL_2", property = "orgLevel2"), @Result(column = "ORG_LEVEL_3", property = "orgLevel3")
@Result(column = "ORG_LEVEL_3", property = "orgLevel3"), @Result(column = "ORG_LEVEL_4", property = "orgLevel4")
@Result(column = "ORG_LEVEL_4", property = "orgLevel4")
})
List<TimestampQueryItem> getTasksCountForStatusGroupedByOrgLevel( List<TimestampQueryItem> getTasksCountForStatusGroupedByOrgLevel(
@Param("status") TaskTimestamp status, @Param("status") TaskTimestamp status,
@Param("classificationCategories") List<String> classificationCategories, @Param("classificationCategories") List<String> classificationCategories,

View File

@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.ClobTypeHandler; import org.apache.ibatis.type.ClobTypeHandler;
@ -33,27 +32,24 @@ public interface AttachmentMapper {
+ "WHERE TASK_ID = #{taskId} " + "WHERE TASK_ID = #{taskId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "taskId", column = "TASK_ID")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "taskId", column = "TASK_ID"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "created", column = "CREATED"), @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID")
@Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), @Result(property = "objectReference.company", column = "REF_COMPANY")
@Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), @Result(property = "objectReference.system", column = "REF_SYSTEM")
@Result(property = "objectReference.company", column = "REF_COMPANY"), @Result(property = "objectReference.systemInstance", column = "REF_INSTANCE")
@Result(property = "objectReference.system", column = "REF_SYSTEM"), @Result(property = "objectReference.type", column = "REF_TYPE")
@Result(property = "objectReference.systemInstance", column = "REF_INSTANCE"), @Result(property = "objectReference.value", column = "REF_VALUE")
@Result(property = "objectReference.type", column = "REF_TYPE"), @Result(property = "channel", column = "CHANNEL")
@Result(property = "objectReference.value", column = "REF_VALUE"), @Result(property = "received", column = "RECEIVED")
@Result(property = "channel", column = "CHANNEL"), @Result(
@Result(property = "received", column = "RECEIVED"), property = "customAttributes",
@Result( column = "CUSTOM_ATTRIBUTES",
property = "customAttributes", javaType = Map.class,
column = "CUSTOM_ATTRIBUTES", typeHandler = MapTypeHandler.class)
javaType = Map.class,
typeHandler = MapTypeHandler.class)
})
List<AttachmentImpl> findAttachmentsByTaskId(@Param("taskId") String taskId); List<AttachmentImpl> findAttachmentsByTaskId(@Param("taskId") String taskId);
@Select( @Select(
@ -71,22 +67,19 @@ public interface AttachmentMapper {
+ "</where>" + "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "taskId", column = "TASK_ID")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "taskId", column = "TASK_ID"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "created", column = "CREATED"), @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID")
@Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), @Result(property = "objectReference.company", column = "REF_COMPANY")
@Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), @Result(property = "objectReference.system", column = "REF_SYSTEM")
@Result(property = "objectReference.company", column = "REF_COMPANY"), @Result(property = "objectReference.systemInstance", column = "REF_INSTANCE")
@Result(property = "objectReference.system", column = "REF_SYSTEM"), @Result(property = "objectReference.type", column = "REF_TYPE")
@Result(property = "objectReference.systemInstance", column = "REF_INSTANCE"), @Result(property = "objectReference.value", column = "REF_VALUE")
@Result(property = "objectReference.type", column = "REF_TYPE"), @Result(property = "channel", column = "CHANNEL")
@Result(property = "objectReference.value", column = "REF_VALUE"), @Result(property = "received", column = "RECEIVED")
@Result(property = "channel", column = "CHANNEL"),
@Result(property = "received", column = "RECEIVED")
})
List<AttachmentSummaryImpl> findAttachmentSummariesByTaskIds( List<AttachmentSummaryImpl> findAttachmentSummariesByTaskIds(
@Param("taskIds") List<String> taskIds); @Param("taskIds") List<String> taskIds);
@ -109,14 +102,11 @@ public interface AttachmentMapper {
"<script> select CUSTOM_ATTRIBUTES from ATTACHMENT where id = #{attachmentId}" "<script> select CUSTOM_ATTRIBUTES from ATTACHMENT where id = #{attachmentId}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(
value = { property = "customAttributes",
@Result( column = "CUSTOM_ATTRIBUTES",
property = "customAttributes", javaType = String.class,
column = "CUSTOM_ATTRIBUTES", typeHandler = ClobTypeHandler.class)
javaType = String.class,
typeHandler = ClobTypeHandler.class)
})
String getCustomAttributesAsString(@Param("attachmentId") String attachmentId); String getCustomAttributesAsString(@Param("attachmentId") String attachmentId);
@Select( @Select(
@ -125,13 +115,8 @@ public interface AttachmentMapper {
+ " WHERE a.CLASSIFICATION_ID = #{classificationId} " + " WHERE a.CLASSIFICATION_ID = #{classificationId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "left", column = "ID")
value = { @Result(property = "right", column = "PLANNED")
@Result(property = "left", column = "ID"),
@Result(property = "right", column = "PLANNED")
// , javaType = Instant.class,
// typeHandler = InstantTypeHandler.class)
})
List<Pair<String, Instant>> findTaskIdsAndPlannedAffectedByClassificationChange( List<Pair<String, Instant>> findTaskIdsAndPlannedAffectedByClassificationChange(
@Param("classificationId") String classificationId); @Param("classificationId") String classificationId);
} }

View File

@ -4,7 +4,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -20,14 +19,12 @@ public interface ObjectReferenceMapper {
+ "WHERE ID = #{id}" + "WHERE ID = #{id}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "company", column = "COMPANY")
@Result(property = "company", column = "COMPANY"), @Result(property = "system", column = "SYSTEM")
@Result(property = "system", column = "SYSTEM"), @Result(property = "systemInstance", column = "SYSTEM_INSTANCE")
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "value", column = "VALUE")
@Result(property = "value", column = "VALUE")
})
ObjectReference findById(@Param("id") String id); ObjectReference findById(@Param("id") String id);
@Select( @Select(
@ -40,14 +37,12 @@ public interface ObjectReferenceMapper {
+ "AND VALUE = #{objectReference.value} " + "AND VALUE = #{objectReference.value} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "company", column = "COMPANY")
@Result(property = "company", column = "COMPANY"), @Result(property = "system", column = "SYSTEM")
@Result(property = "system", column = "SYSTEM"), @Result(property = "systemInstance", column = "SYSTEM_INSTANCE")
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "value", column = "VALUE")
@Result(property = "value", column = "VALUE")
})
ObjectReference findByObjectReference(@Param("objectReference") ObjectReference objectReference); ObjectReference findByObjectReference(@Param("objectReference") ObjectReference objectReference);
@Insert( @Insert(

View File

@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -34,15 +33,12 @@ public interface TaskCommentMapper {
+ " ORDER BY CREATED ASC " + " ORDER BY CREATED ASC "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "taskId", column = "TASK_ID")
@Result(property = "id", column = "ID"), @Result(property = "textField", column = "TEXT_FIELD")
@Result(property = "taskId", column = "TASK_ID"), @Result(property = "creator", column = "CREATOR")
@Result(property = "textField", column = "TEXT_FIELD"), @Result(property = "created", column = "CREATED")
@Result(property = "creator", column = "CREATOR"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "created", column = "CREATED"),
@Result(property = "modified", column = "MODIFIED"),
})
List<TaskCommentImpl> findByTaskId(@Param("taskId") String taskId); List<TaskCommentImpl> findByTaskId(@Param("taskId") String taskId);
@Select( @Select(
@ -51,14 +47,11 @@ public interface TaskCommentMapper {
+ "WHERE ID = #{taskCommentId} " + "WHERE ID = #{taskCommentId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "taskId", column = "TASK_ID")
@Result(property = "id", column = "ID"), @Result(property = "textField", column = "TEXT_FIELD")
@Result(property = "taskId", column = "TASK_ID"), @Result(property = "creator", column = "CREATOR")
@Result(property = "textField", column = "TEXT_FIELD"), @Result(property = "created", column = "CREATED")
@Result(property = "creator", column = "CREATOR"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "created", column = "CREATED"),
@Result(property = "modified", column = "MODIFIED"),
})
TaskCommentImpl findById(@Param("taskCommentId") String taskCommentId); TaskCommentImpl findById(@Param("taskCommentId") String taskCommentId);
} }

View File

@ -8,7 +8,6 @@ import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -32,68 +31,63 @@ public interface TaskMapper {
+ "WHERE ID = #{id} " + "WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "externalId", column = "EXTERNAL_ID")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "externalId", column = "EXTERNAL_ID"), @Result(property = "claimed", column = "CLAIMED")
@Result(property = "created", column = "CREATED"), @Result(property = "completed", column = "COMPLETED")
@Result(property = "claimed", column = "CLAIMED"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "completed", column = "COMPLETED"), @Result(property = "planned", column = "PLANNED")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "due", column = "DUE")
@Result(property = "planned", column = "PLANNED"), @Result(property = "name", column = "NAME")
@Result(property = "due", column = "DUE"), @Result(property = "creator", column = "CREATOR")
@Result(property = "name", column = "NAME"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "creator", column = "CREATOR"), @Result(property = "note", column = "NOTE")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "note", column = "NOTE"), @Result(property = "state", column = "STATE")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID")
@Result(property = "state", column = "STATE"), @Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY")
@Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID"), @Result(property = "classificationSummaryImpl.category", column = "CLASSIFICATION_CATEGORY")
@Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY"), @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID")
@Result( @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY")
property = "classificationSummaryImpl.category", @Result(property = "domain", column = "DOMAIN")
column = "CLASSIFICATION_CATEGORY"), @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID")
@Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID")
@Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), @Result(property = "owner", column = "OWNER")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "primaryObjRef.company", column = "POR_COMPANY")
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.system", column = "POR_SYSTEM")
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE")
@Result(property = "owner", column = "OWNER"), @Result(property = "primaryObjRef.type", column = "POR_TYPE")
@Result(property = "primaryObjRef.company", column = "POR_COMPANY"), @Result(property = "primaryObjRef.value", column = "POR_VALUE")
@Result(property = "primaryObjRef.system", column = "POR_SYSTEM"), @Result(property = "isRead", column = "IS_READ")
@Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE"), @Result(property = "isTransferred", column = "IS_TRANSFERRED")
@Result(property = "primaryObjRef.type", column = "POR_TYPE"), @Result(
@Result(property = "primaryObjRef.value", column = "POR_VALUE"), property = "callbackInfo",
@Result(property = "isRead", column = "IS_READ"), column = "CALLBACK_INFO",
@Result(property = "isTransferred", column = "IS_TRANSFERRED"), javaType = Map.class,
@Result( typeHandler = MapTypeHandler.class)
property = "callbackInfo", @Result(property = "callbackState", column = "CALLBACK_STATE")
column = "CALLBACK_INFO", @Result(
javaType = Map.class, property = "customAttributes",
typeHandler = MapTypeHandler.class), column = "CUSTOM_ATTRIBUTES",
@Result(property = "callbackState", column = "CALLBACK_STATE"), javaType = Map.class,
@Result( typeHandler = MapTypeHandler.class)
property = "customAttributes", @Result(property = "custom1", column = "CUSTOM_1")
column = "CUSTOM_ATTRIBUTES", @Result(property = "custom2", column = "CUSTOM_2")
javaType = Map.class, @Result(property = "custom3", column = "CUSTOM_3")
typeHandler = MapTypeHandler.class), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom9", column = "CUSTOM_9")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom10", column = "CUSTOM_10")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom11", column = "CUSTOM_11")
@Result(property = "custom8", column = "CUSTOM_8"), @Result(property = "custom12", column = "CUSTOM_12")
@Result(property = "custom9", column = "CUSTOM_9"), @Result(property = "custom13", column = "CUSTOM_13")
@Result(property = "custom10", column = "CUSTOM_10"), @Result(property = "custom14", column = "CUSTOM_14")
@Result(property = "custom11", column = "CUSTOM_11"), @Result(property = "custom15", column = "CUSTOM_15")
@Result(property = "custom12", column = "CUSTOM_12"), @Result(property = "custom16", column = "CUSTOM_16")
@Result(property = "custom13", column = "CUSTOM_13"),
@Result(property = "custom14", column = "CUSTOM_14"),
@Result(property = "custom15", column = "CUSTOM_15"),
@Result(property = "custom16", column = "CUSTOM_16")
})
TaskImpl findById(@Param("id") String id); TaskImpl findById(@Param("id") String id);
@Insert( @Insert(
@ -180,19 +174,16 @@ public interface TaskMapper {
+ "</where> " + "</where> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "taskId", column = "ID")
value = { @Result(property = "externalId", column = "EXTERNAL_ID")
@Result(property = "taskId", column = "ID"), @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "externalId", column = "EXTERNAL_ID"), @Result(property = "classificationId", column = "CLASSIFICATION_ID")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "owner", column = "OWNER")
@Result(property = "classificationId", column = "CLASSIFICATION_ID"), @Result(property = "taskState", column = "STATE")
@Result(property = "owner", column = "OWNER"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "taskState", column = "STATE"), @Result(property = "due", column = "DUE")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "planned", column = "PLANNED")
@Result(property = "due", column = "DUE"), @Result(property = "callbackState", column = "CALLBACK_STATE")
@Result(property = "planned", column = "PLANNED"),
@Result(property = "callbackState", column = "CALLBACK_STATE")
})
List<MinimalTaskSummary> findExistingTasks( List<MinimalTaskSummary> findExistingTasks(
@Param("taskIds") List<String> taskIds, @Param("externalIds") List<String> externalIds); @Param("taskIds") List<String> taskIds, @Param("externalIds") List<String> externalIds);
@ -258,15 +249,12 @@ public interface TaskMapper {
+ "AND STATE IN ( 'READY','CLAIMED') " + "AND STATE IN ( 'READY','CLAIMED') "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "left", column = "ID")
value = { @Result(
@Result(property = "left", column = "ID"), property = "right",
@Result( column = "PLANNED",
property = "right", javaType = Instant.class,
column = "PLANNED", typeHandler = InstantTypeHandler.class)
javaType = Instant.class,
typeHandler = InstantTypeHandler.class)
})
List<Pair<String, Instant>> filterTaskIdsForReadyAndClaimed( List<Pair<String, Instant>> filterTaskIdsForReadyAndClaimed(
@Param("taskIds") List<String> taskIds); @Param("taskIds") List<String> taskIds);
@ -292,7 +280,7 @@ public interface TaskMapper {
+ "</otherwise>" + "</otherwise>"
+ "</choose>" + "</choose>"
+ "</script>") + "</script>")
@Results(value = {@Result(property = "id", column = "ID")}) @Result(property = "id", column = "ID")
List<String> filterTaskIdsNotAuthorizedFor( List<String> filterTaskIdsNotAuthorizedFor(
@Param("taskIds") List<String> taskIds, @Param("accessIds") List<String> accessIds); @Param("taskIds") List<String> taskIds, @Param("accessIds") List<String> accessIds);
} }

View File

@ -2,7 +2,6 @@ package pro.taskana.task.internal;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.task.api.models.ObjectReference; import pro.taskana.task.api.models.ObjectReference;
@ -154,58 +153,53 @@ public interface TaskQueryMapper {
+ "<if test='selectAndClaim == true'> FETCH FIRST ROW ONLY FOR UPDATE </if>" + "<if test='selectAndClaim == true'> FETCH FIRST ROW ONLY FOR UPDATE </if>"
+ "<if test=\"_databaseId == 'db2'\">WITH RS USE AND KEEP UPDATE LOCKS </if> " + "<if test=\"_databaseId == 'db2'\">WITH RS USE AND KEEP UPDATE LOCKS </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "externalId", column = "EXTERNAL_ID")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "externalId", column = "EXTERNAL_ID"), @Result(property = "claimed", column = "CLAIMED")
@Result(property = "created", column = "CREATED"), @Result(property = "completed", column = "COMPLETED")
@Result(property = "claimed", column = "CLAIMED"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "completed", column = "COMPLETED"), @Result(property = "planned", column = "PLANNED")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "due", column = "DUE")
@Result(property = "planned", column = "PLANNED"), @Result(property = "name", column = "NAME")
@Result(property = "due", column = "DUE"), @Result(property = "creator", column = "CREATOR")
@Result(property = "name", column = "NAME"), @Result(property = "note", column = "NOTE")
@Result(property = "creator", column = "CREATOR"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "note", column = "NOTE"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "state", column = "STATE")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "workbasketSummaryImpl.domain", column = "DOMAIN")
@Result(property = "state", column = "STATE"), @Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY")
@Result(property = "workbasketSummaryImpl.domain", column = "DOMAIN"), @Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID")
@Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY"), @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY")
@Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID"), @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID")
@Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), @Result(property = "classificationSummaryImpl.domain", column = "DOMAIN")
@Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), @Result(property = "classificationSummaryImpl.category", column = "CLASSIFICATION_CATEGORY")
@Result(property = "classificationSummaryImpl.domain", column = "DOMAIN"), @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID")
@Result( @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID")
property = "classificationSummaryImpl.category", @Result(property = "owner", column = "OWNER")
column = "CLASSIFICATION_CATEGORY"), @Result(property = "primaryObjRef.company", column = "POR_COMPANY")
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.system", column = "POR_SYSTEM")
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE")
@Result(property = "owner", column = "OWNER"), @Result(property = "primaryObjRef.type", column = "POR_TYPE")
@Result(property = "primaryObjRef.company", column = "POR_COMPANY"), @Result(property = "primaryObjRef.value", column = "POR_VALUE")
@Result(property = "primaryObjRef.system", column = "POR_SYSTEM"), @Result(property = "isRead", column = "IS_READ")
@Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE"), @Result(property = "isTransferred", column = "IS_TRANSFERRED")
@Result(property = "primaryObjRef.type", column = "POR_TYPE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "primaryObjRef.value", column = "POR_VALUE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "isRead", column = "IS_READ"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "isTransferred", column = "IS_TRANSFERRED"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom9", column = "CUSTOM_9")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom10", column = "CUSTOM_10")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom11", column = "CUSTOM_11")
@Result(property = "custom8", column = "CUSTOM_8"), @Result(property = "custom12", column = "CUSTOM_12")
@Result(property = "custom9", column = "CUSTOM_9"), @Result(property = "custom13", column = "CUSTOM_13")
@Result(property = "custom10", column = "CUSTOM_10"), @Result(property = "custom14", column = "CUSTOM_14")
@Result(property = "custom11", column = "CUSTOM_11"), @Result(property = "custom15", column = "CUSTOM_15")
@Result(property = "custom12", column = "CUSTOM_12"), @Result(property = "custom16", column = "CUSTOM_16")
@Result(property = "custom13", column = "CUSTOM_13"),
@Result(property = "custom14", column = "CUSTOM_14"),
@Result(property = "custom15", column = "CUSTOM_15"),
@Result(property = "custom16", column = "CUSTOM_16")
})
List<TaskSummaryImpl> queryTaskSummaries(TaskQueryImpl taskQuery); List<TaskSummaryImpl> queryTaskSummaries(TaskQueryImpl taskQuery);
@Select( @Select(
@ -422,58 +416,53 @@ public interface TaskQueryMapper {
+ "<if test='selectAndClaim == true'>FETCH FIRST ROW ONLY FOR UPDATE WITH RS USE AND KEEP UPDATE LOCKS</if>" + "<if test='selectAndClaim == true'>FETCH FIRST ROW ONLY FOR UPDATE WITH RS USE AND KEEP UPDATE LOCKS</if>"
+ "<if test='selectAndClaim == false'> with UR</if>" + "<if test='selectAndClaim == false'> with UR</if>"
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "externalId", column = "EXTERNAL_ID")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "externalId", column = "EXTERNAL_ID"), @Result(property = "claimed", column = "CLAIMED")
@Result(property = "created", column = "CREATED"), @Result(property = "completed", column = "COMPLETED")
@Result(property = "claimed", column = "CLAIMED"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "completed", column = "COMPLETED"), @Result(property = "planned", column = "PLANNED")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "due", column = "DUE")
@Result(property = "planned", column = "PLANNED"), @Result(property = "name", column = "NAME")
@Result(property = "due", column = "DUE"), @Result(property = "creator", column = "CREATOR")
@Result(property = "name", column = "NAME"), @Result(property = "note", column = "NOTE")
@Result(property = "creator", column = "CREATOR"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "note", column = "NOTE"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "state", column = "STATE")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "workbasketSummaryImpl.domain", column = "DOMAIN")
@Result(property = "state", column = "STATE"), @Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY")
@Result(property = "workbasketSummaryImpl.domain", column = "DOMAIN"), @Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID")
@Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY"), @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY")
@Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID"), @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID")
@Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), @Result(property = "classificationSummaryImpl.domain", column = "DOMAIN")
@Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), @Result(property = "classificationSummaryImpl.category", column = "CLASSIFICATION_CATEGORY")
@Result(property = "classificationSummaryImpl.domain", column = "DOMAIN"), @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID")
@Result( @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID")
property = "classificationSummaryImpl.category", @Result(property = "owner", column = "OWNER")
column = "CLASSIFICATION_CATEGORY"), @Result(property = "primaryObjRef.company", column = "POR_COMPANY")
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.system", column = "POR_SYSTEM")
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE")
@Result(property = "owner", column = "OWNER"), @Result(property = "primaryObjRef.type", column = "POR_TYPE")
@Result(property = "primaryObjRef.company", column = "POR_COMPANY"), @Result(property = "primaryObjRef.value", column = "POR_VALUE")
@Result(property = "primaryObjRef.system", column = "POR_SYSTEM"), @Result(property = "isRead", column = "IS_READ")
@Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE"), @Result(property = "isTransferred", column = "IS_TRANSFERRED")
@Result(property = "primaryObjRef.type", column = "POR_TYPE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "primaryObjRef.value", column = "POR_VALUE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "isRead", column = "IS_READ"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "isTransferred", column = "IS_TRANSFERRED"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom9", column = "CUSTOM_9")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom10", column = "CUSTOM_10")
@Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom11", column = "CUSTOM_11")
@Result(property = "custom8", column = "CUSTOM_8"), @Result(property = "custom12", column = "CUSTOM_12")
@Result(property = "custom9", column = "CUSTOM_9"), @Result(property = "custom13", column = "CUSTOM_13")
@Result(property = "custom10", column = "CUSTOM_10"), @Result(property = "custom14", column = "CUSTOM_14")
@Result(property = "custom11", column = "CUSTOM_11"), @Result(property = "custom15", column = "CUSTOM_15")
@Result(property = "custom12", column = "CUSTOM_12"), @Result(property = "custom16", column = "CUSTOM_16")
@Result(property = "custom13", column = "CUSTOM_13"),
@Result(property = "custom14", column = "CUSTOM_14"),
@Result(property = "custom15", column = "CUSTOM_15"),
@Result(property = "custom16", column = "CUSTOM_16")
})
List<TaskSummaryImpl> queryTaskSummariesDb2(TaskQueryImpl taskQuery); List<TaskSummaryImpl> queryTaskSummariesDb2(TaskQueryImpl taskQuery);
@Select( @Select(
@ -488,14 +477,12 @@ public interface TaskQueryMapper {
+ "</where>" + "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "company", column = "COMPANY")
@Result(property = "company", column = "COMPANY"), @Result(property = "system", column = "SYSTEM")
@Result(property = "system", column = "SYSTEM"), @Result(property = "systemInstance", column = "SYSTEM_INSTANCE")
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "value", column = "VALUE")
@Result(property = "value", column = "VALUE")
})
List<ObjectReference> queryObjectReferences(ObjectReferenceQueryImpl objectReference); List<ObjectReference> queryObjectReferences(ObjectReferenceQueryImpl objectReference);
@Select( @Select(

View File

@ -6,7 +6,6 @@ import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -21,30 +20,27 @@ public interface WorkbasketAccessMapper {
+ "FROM WORKBASKET_ACCESS_LIST WHERE ID = #{id} " + "FROM WORKBASKET_ACCESS_LIST WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "id", column = "ID"), @Result(property = "accessId", column = "ACCESS_ID")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "accessName", column = "ACCESS_NAME")
@Result(property = "accessId", column = "ACCESS_ID"), @Result(property = "permRead", column = "PERM_READ")
@Result(property = "accessName", column = "ACCESS_NAME"), @Result(property = "permOpen", column = "PERM_OPEN")
@Result(property = "permRead", column = "PERM_READ"), @Result(property = "permAppend", column = "PERM_APPEND")
@Result(property = "permOpen", column = "PERM_OPEN"), @Result(property = "permTransfer", column = "PERM_TRANSFER")
@Result(property = "permAppend", column = "PERM_APPEND"), @Result(property = "permDistribute", column = "PERM_DISTRIBUTE")
@Result(property = "permTransfer", column = "PERM_TRANSFER"), @Result(property = "permCustom1", column = "PERM_CUSTOM_1")
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"), @Result(property = "permCustom2", column = "PERM_CUSTOM_2")
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"), @Result(property = "permCustom3", column = "PERM_CUSTOM_3")
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"), @Result(property = "permCustom4", column = "PERM_CUSTOM_4")
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"), @Result(property = "permCustom5", column = "PERM_CUSTOM_5")
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"), @Result(property = "permCustom6", column = "PERM_CUSTOM_6")
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"), @Result(property = "permCustom7", column = "PERM_CUSTOM_7")
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"), @Result(property = "permCustom8", column = "PERM_CUSTOM_8")
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"), @Result(property = "permCustom9", column = "PERM_CUSTOM_9")
@Result(property = "permCustom8", column = "PERM_CUSTOM_8"), @Result(property = "permCustom10", column = "PERM_CUSTOM_10")
@Result(property = "permCustom9", column = "PERM_CUSTOM_9"), @Result(property = "permCustom11", column = "PERM_CUSTOM_11")
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"), @Result(property = "permCustom12", column = "PERM_CUSTOM_12")
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"),
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")
})
WorkbasketAccessItemImpl findById(@Param("id") String id); WorkbasketAccessItemImpl findById(@Param("id") String id);
@Select( @Select(
@ -52,31 +48,28 @@ public interface WorkbasketAccessMapper {
+ "FROM WORKBASKET_ACCESS_LIST AS WBA LEFT JOIN WORKBASKET AS WB ON WORKBASKET_ID = WB.ID WHERE WORKBASKET_ID = #{id} " + "FROM WORKBASKET_ACCESS_LIST AS WBA LEFT JOIN WORKBASKET AS WB ON WORKBASKET_ID = WB.ID WHERE WORKBASKET_ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "id", column = "ID"), @Result(property = "workbasketKey", column = "KEY")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "accessId", column = "ACCESS_ID")
@Result(property = "workbasketKey", column = "KEY"), @Result(property = "accessName", column = "ACCESS_NAME")
@Result(property = "accessId", column = "ACCESS_ID"), @Result(property = "permRead", column = "PERM_READ")
@Result(property = "accessName", column = "ACCESS_NAME"), @Result(property = "permOpen", column = "PERM_OPEN")
@Result(property = "permRead", column = "PERM_READ"), @Result(property = "permAppend", column = "PERM_APPEND")
@Result(property = "permOpen", column = "PERM_OPEN"), @Result(property = "permTransfer", column = "PERM_TRANSFER")
@Result(property = "permAppend", column = "PERM_APPEND"), @Result(property = "permDistribute", column = "PERM_DISTRIBUTE")
@Result(property = "permTransfer", column = "PERM_TRANSFER"), @Result(property = "permCustom1", column = "PERM_CUSTOM_1")
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"), @Result(property = "permCustom2", column = "PERM_CUSTOM_2")
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"), @Result(property = "permCustom3", column = "PERM_CUSTOM_3")
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"), @Result(property = "permCustom4", column = "PERM_CUSTOM_4")
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"), @Result(property = "permCustom5", column = "PERM_CUSTOM_5")
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"), @Result(property = "permCustom6", column = "PERM_CUSTOM_6")
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"), @Result(property = "permCustom7", column = "PERM_CUSTOM_7")
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"), @Result(property = "permCustom8", column = "PERM_CUSTOM_8")
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"), @Result(property = "permCustom9", column = "PERM_CUSTOM_9")
@Result(property = "permCustom8", column = "PERM_CUSTOM_8"), @Result(property = "permCustom10", column = "PERM_CUSTOM_10")
@Result(property = "permCustom9", column = "PERM_CUSTOM_9"), @Result(property = "permCustom11", column = "PERM_CUSTOM_11")
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"), @Result(property = "permCustom12", column = "PERM_CUSTOM_12")
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"),
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")
})
List<WorkbasketAccessItemImpl> findByWorkbasketId(@Param("id") String id); List<WorkbasketAccessItemImpl> findByWorkbasketId(@Param("id") String id);
@Select( @Select(
@ -84,31 +77,28 @@ public interface WorkbasketAccessMapper {
+ "FROM WORKBASKET_ACCESS_LIST AS WBA LEFT JOIN WORKBASKET AS WB ON WORKBASKET_ID = WB.ID WHERE ACCESS_ID = #{id} " + "FROM WORKBASKET_ACCESS_LIST AS WBA LEFT JOIN WORKBASKET AS WB ON WORKBASKET_ID = WB.ID WHERE ACCESS_ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "id", column = "ID"), @Result(property = "workbasketKey", column = "KEY")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "accessId", column = "ACCESS_ID")
@Result(property = "workbasketKey", column = "KEY"), @Result(property = "accessName", column = "ACCESS_NAME")
@Result(property = "accessId", column = "ACCESS_ID"), @Result(property = "permRead", column = "PERM_READ")
@Result(property = "accessName", column = "ACCESS_NAME"), @Result(property = "permOpen", column = "PERM_OPEN")
@Result(property = "permRead", column = "PERM_READ"), @Result(property = "permAppend", column = "PERM_APPEND")
@Result(property = "permOpen", column = "PERM_OPEN"), @Result(property = "permTransfer", column = "PERM_TRANSFER")
@Result(property = "permAppend", column = "PERM_APPEND"), @Result(property = "permDistribute", column = "PERM_DISTRIBUTE")
@Result(property = "permTransfer", column = "PERM_TRANSFER"), @Result(property = "permCustom1", column = "PERM_CUSTOM_1")
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"), @Result(property = "permCustom2", column = "PERM_CUSTOM_2")
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"), @Result(property = "permCustom3", column = "PERM_CUSTOM_3")
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"), @Result(property = "permCustom4", column = "PERM_CUSTOM_4")
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"), @Result(property = "permCustom5", column = "PERM_CUSTOM_5")
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"), @Result(property = "permCustom6", column = "PERM_CUSTOM_6")
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"), @Result(property = "permCustom7", column = "PERM_CUSTOM_7")
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"), @Result(property = "permCustom8", column = "PERM_CUSTOM_8")
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"), @Result(property = "permCustom9", column = "PERM_CUSTOM_9")
@Result(property = "permCustom8", column = "PERM_CUSTOM_8"), @Result(property = "permCustom10", column = "PERM_CUSTOM_10")
@Result(property = "permCustom9", column = "PERM_CUSTOM_9"), @Result(property = "permCustom11", column = "PERM_CUSTOM_11")
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"), @Result(property = "permCustom12", column = "PERM_CUSTOM_12")
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"),
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")
})
List<WorkbasketAccessItemImpl> findByAccessId(@Param("id") String id); List<WorkbasketAccessItemImpl> findByAccessId(@Param("id") String id);
@Insert( @Insert(
@ -146,30 +136,27 @@ public interface WorkbasketAccessMapper {
+ "AND ACCESS_ID IN(<foreach item='item' collection='accessIds' separator=',' >#{item}</foreach>) " + "AND ACCESS_ID IN(<foreach item='item' collection='accessIds' separator=',' >#{item}</foreach>) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "id", column = "ID"), @Result(property = "accessId", column = "ACCESS_ID")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "accessName", column = "ACCESS_NAME")
@Result(property = "accessId", column = "ACCESS_ID"), @Result(property = "permRead", column = "P_READ")
@Result(property = "accessName", column = "ACCESS_NAME"), @Result(property = "permOpen", column = "P_OPEN")
@Result(property = "permRead", column = "P_READ"), @Result(property = "permAppend", column = "P_APPEND")
@Result(property = "permOpen", column = "P_OPEN"), @Result(property = "permTransfer", column = "P_TRANSFER")
@Result(property = "permAppend", column = "P_APPEND"), @Result(property = "permDistribute", column = "P_DISTRIBUTE")
@Result(property = "permTransfer", column = "P_TRANSFER"), @Result(property = "permCustom1", column = "P_CUSTOM_1")
@Result(property = "permDistribute", column = "P_DISTRIBUTE"), @Result(property = "permCustom2", column = "P_CUSTOM_2")
@Result(property = "permCustom1", column = "P_CUSTOM_1"), @Result(property = "permCustom3", column = "P_CUSTOM_3")
@Result(property = "permCustom2", column = "P_CUSTOM_2"), @Result(property = "permCustom4", column = "P_CUSTOM_4")
@Result(property = "permCustom3", column = "P_CUSTOM_3"), @Result(property = "permCustom5", column = "P_CUSTOM_5")
@Result(property = "permCustom4", column = "P_CUSTOM_4"), @Result(property = "permCustom6", column = "P_CUSTOM_6")
@Result(property = "permCustom5", column = "P_CUSTOM_5"), @Result(property = "permCustom7", column = "P_CUSTOM_7")
@Result(property = "permCustom6", column = "P_CUSTOM_6"), @Result(property = "permCustom8", column = "P_CUSTOM_8")
@Result(property = "permCustom7", column = "P_CUSTOM_7"), @Result(property = "permCustom9", column = "P_CUSTOM_9")
@Result(property = "permCustom8", column = "P_CUSTOM_8"), @Result(property = "permCustom10", column = "P_CUSTOM_10")
@Result(property = "permCustom9", column = "P_CUSTOM_9"), @Result(property = "permCustom11", column = "P_CUSTOM_11")
@Result(property = "permCustom10", column = "P_CUSTOM_10"), @Result(property = "permCustom12", column = "P_CUSTOM_12")
@Result(property = "permCustom11", column = "P_CUSTOM_11"),
@Result(property = "permCustom12", column = "P_CUSTOM_12")
})
WorkbasketAccessItemImpl findByWorkbasketAndAccessId( WorkbasketAccessItemImpl findByWorkbasketAndAccessId(
@Param("workbasketId") String workbasketId, @Param("accessIds") List<String> accessIds); @Param("workbasketId") String workbasketId, @Param("accessIds") List<String> accessIds);
@ -188,29 +175,26 @@ public interface WorkbasketAccessMapper {
+ "AND ACCESS_ID IN(<foreach item='item' collection='accessIds' separator=',' >#{item}</foreach>) " + "AND ACCESS_ID IN(<foreach item='item' collection='accessIds' separator=',' >#{item}</foreach>) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "workbasketId", column = "WORKBASKET_ID")
value = { @Result(property = "accessId", column = "ACCESS_ID")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "accessName", column = "ACCESS_NAME")
@Result(property = "accessId", column = "ACCESS_ID"), @Result(property = "permRead", column = "P_READ")
@Result(property = "accessName", column = "ACCESS_NAME"), @Result(property = "permOpen", column = "P_OPEN")
@Result(property = "permRead", column = "P_READ"), @Result(property = "permAppend", column = "P_APPEND")
@Result(property = "permOpen", column = "P_OPEN"), @Result(property = "permTransfer", column = "P_TRANSFER")
@Result(property = "permAppend", column = "P_APPEND"), @Result(property = "permDistribute", column = "P_DISTRIBUTE")
@Result(property = "permTransfer", column = "P_TRANSFER"), @Result(property = "permCustom1", column = "P_CUSTOM_1")
@Result(property = "permDistribute", column = "P_DISTRIBUTE"), @Result(property = "permCustom2", column = "P_CUSTOM_2")
@Result(property = "permCustom1", column = "P_CUSTOM_1"), @Result(property = "permCustom3", column = "P_CUSTOM_3")
@Result(property = "permCustom2", column = "P_CUSTOM_2"), @Result(property = "permCustom4", column = "P_CUSTOM_4")
@Result(property = "permCustom3", column = "P_CUSTOM_3"), @Result(property = "permCustom5", column = "P_CUSTOM_5")
@Result(property = "permCustom4", column = "P_CUSTOM_4"), @Result(property = "permCustom6", column = "P_CUSTOM_6")
@Result(property = "permCustom5", column = "P_CUSTOM_5"), @Result(property = "permCustom7", column = "P_CUSTOM_7")
@Result(property = "permCustom6", column = "P_CUSTOM_6"), @Result(property = "permCustom8", column = "P_CUSTOM_8")
@Result(property = "permCustom7", column = "P_CUSTOM_7"), @Result(property = "permCustom9", column = "P_CUSTOM_9")
@Result(property = "permCustom8", column = "P_CUSTOM_8"), @Result(property = "permCustom10", column = "P_CUSTOM_10")
@Result(property = "permCustom9", column = "P_CUSTOM_9"), @Result(property = "permCustom11", column = "P_CUSTOM_11")
@Result(property = "permCustom10", column = "P_CUSTOM_10"), @Result(property = "permCustom12", column = "P_CUSTOM_12")
@Result(property = "permCustom11", column = "P_CUSTOM_11"),
@Result(property = "permCustom12", column = "P_CUSTOM_12")
})
WorkbasketAccessItemImpl findByWorkbasketKeyDomainAndAccessId( WorkbasketAccessItemImpl findByWorkbasketKeyDomainAndAccessId(
@Param("workbasketKey") String workbasketKey, @Param("workbasketKey") String workbasketKey,
@Param("domain") String domain, @Param("domain") String domain,

View File

@ -6,7 +6,6 @@ import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
@ -21,78 +20,69 @@ public interface WorkbasketMapper {
"<script>SELECT ID, KEY, CREATED, MODIFIED, NAME, DOMAIN, TYPE, DESCRIPTION, OWNER, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION FROM WORKBASKET WHERE ID = #{id} " "<script>SELECT ID, KEY, CREATED, MODIFIED, NAME, DOMAIN, TYPE, DESCRIPTION, OWNER, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION FROM WORKBASKET WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "key", column = "KEY")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "key", column = "KEY"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "created", column = "CREATED"), @Result(property = "name", column = "NAME")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "name", column = "NAME"), @Result(property = "type", column = "TYPE")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "type", column = "TYPE"), @Result(property = "owner", column = "OWNER")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "owner", column = "OWNER"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"), @Result(property = "markedForDeletion", column = "MARKED_FOR_DELETION")
@Result(property = "orgLevel4", column = "ORG_LEVEL_4"),
@Result(property = "markedForDeletion", column = "MARKED_FOR_DELETION")
})
WorkbasketImpl findById(@Param("id") String id); WorkbasketImpl findById(@Param("id") String id);
@Select( @Select(
"<script>SELECT ID, KEY, CREATED, MODIFIED, NAME, DOMAIN, TYPE, DESCRIPTION, OWNER, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION FROM WORKBASKET WHERE UPPER(KEY) = UPPER(#{key}) and UPPER(DOMAIN) = UPPER(#{domain}) " "<script>SELECT ID, KEY, CREATED, MODIFIED, NAME, DOMAIN, TYPE, DESCRIPTION, OWNER, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION FROM WORKBASKET WHERE UPPER(KEY) = UPPER(#{key}) and UPPER(DOMAIN) = UPPER(#{domain}) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "key", column = "KEY")
@Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED")
@Result(property = "key", column = "KEY"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "created", column = "CREATED"), @Result(property = "name", column = "NAME")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "name", column = "NAME"), @Result(property = "type", column = "TYPE")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "type", column = "TYPE"), @Result(property = "owner", column = "OWNER")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "owner", column = "OWNER"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"), @Result(property = "markedForDeletion", column = "MARKED_FOR_DELETION")
@Result(property = "orgLevel4", column = "ORG_LEVEL_4"),
@Result(property = "markedForDeletion", column = "MARKED_FOR_DELETION")
})
WorkbasketImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain); WorkbasketImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain);
@Select( @Select(
"<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID IN (SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{id}) " "<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID IN (SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{id}) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "key", column = "KEY")
@Result(property = "id", column = "ID"), @Result(property = "name", column = "NAME")
@Result(property = "key", column = "KEY"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "name", column = "NAME"), @Result(property = "owner", column = "OWNER")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "owner", column = "OWNER"), @Result(property = "type", column = "TYPE")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "type", column = "TYPE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")
})
List<WorkbasketSummaryImpl> findDistributionTargets(@Param("id") String id); List<WorkbasketSummaryImpl> findDistributionTargets(@Param("id") String id);
@Select( @Select(
@ -100,72 +90,63 @@ public interface WorkbasketMapper {
+ " WHERE ID IN (SELECT SOURCE_ID FROM DISTRIBUTION_TARGETS WHERE TARGET_ID = #{id}) " + " WHERE ID IN (SELECT SOURCE_ID FROM DISTRIBUTION_TARGETS WHERE TARGET_ID = #{id}) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "key", column = "KEY")
@Result(property = "id", column = "ID"), @Result(property = "name", column = "NAME")
@Result(property = "key", column = "KEY"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "name", column = "NAME"), @Result(property = "owner", column = "OWNER")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "owner", column = "OWNER"), @Result(property = "type", column = "TYPE")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "type", column = "TYPE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")
})
List<WorkbasketSummaryImpl> findDistributionSources(@Param("id") String id); List<WorkbasketSummaryImpl> findDistributionSources(@Param("id") String id);
@Select( @Select(
"<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID = #{id} " "<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "key", column = "KEY")
@Result(property = "id", column = "ID"), @Result(property = "name", column = "NAME")
@Result(property = "key", column = "KEY"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "name", column = "NAME"), @Result(property = "owner", column = "OWNER")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "owner", column = "OWNER"), @Result(property = "type", column = "TYPE")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "type", column = "TYPE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")
})
List<WorkbasketSummaryImpl> findSummaryById(@Param("key") String id); List<WorkbasketSummaryImpl> findSummaryById(@Param("key") String id);
@Select( @Select(
"<script>SELECT * FROM WORKBASKET ORDER BY id " "<script>SELECT * FROM WORKBASKET ORDER BY id "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "key", column = "KEY")
@Result(property = "id", column = "ID"), @Result(property = "name", column = "NAME")
@Result(property = "key", column = "KEY"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "name", column = "NAME"), @Result(property = "owner", column = "OWNER")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "owner", column = "OWNER"), @Result(property = "type", column = "TYPE")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "type", column = "TYPE"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")
})
List<WorkbasketSummaryImpl> findAll(); List<WorkbasketSummaryImpl> findAll();
@Insert( @Insert(

View File

@ -2,7 +2,6 @@ package pro.taskana.workbasket.internal;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import pro.taskana.workbasket.api.WorkbasketAccessItemQuery; import pro.taskana.workbasket.api.WorkbasketAccessItemQuery;
@ -97,24 +96,22 @@ public interface WorkbasketQueryMapper {
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> " + "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "key", column = "KEY")
@Result(property = "key", column = "KEY"), @Result(property = "name", column = "NAME")
@Result(property = "name", column = "NAME"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "owner", column = "OWNER")
@Result(property = "owner", column = "OWNER"), @Result(property = "domain", column = "DOMAIN")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "type", column = "TYPE")
@Result(property = "type", column = "TYPE"), @Result(property = "custom1", column = "CUSTOM_1")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom2", column = "CUSTOM_2")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom3", column = "CUSTOM_3")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "orgLevel1", column = "ORG_LEVEL_1")
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"), @Result(property = "orgLevel2", column = "ORG_LEVEL_2")
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"), @Result(property = "orgLevel3", column = "ORG_LEVEL_3")
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"), @Result(property = "orgLevel4", column = "ORG_LEVEL_4")
@Result(property = "orgLevel4", column = "ORG_LEVEL_4"), @Result(property = "markedForDeletion", column = "MARKED_FOR_DELETION")
@Result(property = "markedForDeletion", column = "MARKED_FOR_DELETION")
})
List<WorkbasketSummaryImpl> queryWorkbasketSummaries(WorkbasketQueryImpl workbasketQuery); List<WorkbasketSummaryImpl> queryWorkbasketSummaries(WorkbasketQueryImpl workbasketQuery);
@Select( @Select(
@ -133,30 +130,28 @@ public interface WorkbasketQueryMapper {
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> " + "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> " + "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>") + "</script>")
@Results({ @Result(property = "id", column = "ID")
@Result(property = "id", column = "ID"), @Result(property = "workbasketId", column = "WORKBASKET_ID")
@Result(property = "workbasketId", column = "WORKBASKET_ID"), @Result(property = "workbasketKey", column = "KEY")
@Result(property = "workbasketKey", column = "KEY"), @Result(property = "accessId", column = "ACCESS_ID")
@Result(property = "accessId", column = "ACCESS_ID"), @Result(property = "accessName", column = "ACCESS_NAME")
@Result(property = "accessName", column = "ACCESS_NAME"), @Result(property = "permRead", column = "PERM_READ")
@Result(property = "permRead", column = "PERM_READ"), @Result(property = "permOpen", column = "PERM_OPEN")
@Result(property = "permOpen", column = "PERM_OPEN"), @Result(property = "permAppend", column = "PERM_APPEND")
@Result(property = "permAppend", column = "PERM_APPEND"), @Result(property = "permTransfer", column = "PERM_TRANSFER")
@Result(property = "permTransfer", column = "PERM_TRANSFER"), @Result(property = "permDistribute", column = "PERM_DISTRIBUTE")
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"), @Result(property = "permCustom1", column = "PERM_CUSTOM_1")
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"), @Result(property = "permCustom2", column = "PERM_CUSTOM_2")
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"), @Result(property = "permCustom3", column = "PERM_CUSTOM_3")
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"), @Result(property = "permCustom4", column = "PERM_CUSTOM_4")
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"), @Result(property = "permCustom5", column = "PERM_CUSTOM_5")
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"), @Result(property = "permCustom6", column = "PERM_CUSTOM_6")
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"), @Result(property = "permCustom7", column = "PERM_CUSTOM_7")
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"), @Result(property = "permCustom8", column = "PERM_CUSTOM_8")
@Result(property = "permCustom8", column = "PERM_CUSTOM_8"), @Result(property = "permCustom9", column = "PERM_CUSTOM_9")
@Result(property = "permCustom9", column = "PERM_CUSTOM_9"), @Result(property = "permCustom10", column = "PERM_CUSTOM_10")
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"), @Result(property = "permCustom11", column = "PERM_CUSTOM_11")
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"), @Result(property = "permCustom12", column = "PERM_CUSTOM_12")
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")
})
List<WorkbasketAccessItemImpl> queryWorkbasketAccessItems( List<WorkbasketAccessItemImpl> queryWorkbasketAccessItems(
WorkbasketAccessItemQuery accessItemQuery); WorkbasketAccessItemQuery accessItemQuery);

View File

@ -42,12 +42,10 @@ public class WorkbasketCleanupJob extends AbstractTaskanaJob {
LOGGER.info("Running job to delete all workbaskets marked for deletion"); LOGGER.info("Running job to delete all workbaskets marked for deletion");
try { try {
List<String> workbasketsMarkedForDeletion = getWorkbasketsMarkedForDeletion(); List<String> workbasketsMarkedForDeletion = getWorkbasketsMarkedForDeletion();
int totalNumberOfWorkbasketDeleted = int totalNumberOfWorkbasketDeleted =
CollectionUtil.partitionBasedOnSize(workbasketsMarkedForDeletion, batchSize).stream() CollectionUtil.partitionBasedOnSize(workbasketsMarkedForDeletion, batchSize).stream()
.mapToInt(this::deleteWorkbasketsTransactionally) .mapToInt(this::deleteWorkbasketsTransactionally)
.sum(); .sum();
LOGGER.info( LOGGER.info(
"Job ended successfully. {} workbaskets deleted.", totalNumberOfWorkbasketDeleted); "Job ended successfully. {} workbaskets deleted.", totalNumberOfWorkbasketDeleted);
} catch (Exception e) { } catch (Exception e) {

View File

@ -89,6 +89,7 @@ public class WorkbasketImpl extends WorkbasketSummaryImpl implements Workbasket
return result; return result;
} }
@Override
protected boolean canEqual(Object other) { protected boolean canEqual(Object other) {
return (other instanceof WorkbasketImpl); return (other instanceof WorkbasketImpl);
} }

View File

@ -100,11 +100,11 @@ class ProvideClassificationReportAccTest extends AbstractReportAccTest {
assertThat(report.getRow("L30000").getTotalValue()).isEqualTo(7); assertThat(report.getRow("L30000").getTotalValue()).isEqualTo(7);
assertThat(report.getRow("L40000").getTotalValue()).isEqualTo(10); assertThat(report.getRow("L40000").getTotalValue()).isEqualTo(10);
assertThat(report.getRow("L50000").getTotalValue()).isEqualTo(13); assertThat(report.getRow("L50000").getTotalValue()).isEqualTo(13);
assertThat(report.getRow("L10000").getCells().length).isEqualTo(0); assertThat(report.getRow("L10000").getCells()).isEmpty();
assertThat(report.getRow("L20000").getCells().length).isEqualTo(0); assertThat(report.getRow("L20000").getCells()).isEmpty();
assertThat(report.getRow("L30000").getCells().length).isEqualTo(0); assertThat(report.getRow("L30000").getCells()).isEmpty();
assertThat(report.getRow("L40000").getCells().length).isEqualTo(0); assertThat(report.getRow("L40000").getCells()).isEmpty();
assertThat(report.getRow("L50000").getCells().length).isEqualTo(0); assertThat(report.getRow("L50000").getCells()).isEmpty();
assertThat(report.getSumRow().getTotalValue()).isEqualTo(50); assertThat(report.getSumRow().getTotalValue()).isEqualTo(50);
} }

View File

@ -135,14 +135,14 @@ class ProvideDetailedClassificationReportAccTest extends AbstractReportAccTest {
assertThat(row1.getTotalValue()).isEqualTo(10); assertThat(row1.getTotalValue()).isEqualTo(10);
assertThat(row1.getFoldableRow("L11000").getTotalValue()).isEqualTo(3); assertThat(row1.getFoldableRow("L11000").getTotalValue()).isEqualTo(3);
assertThat(row1.getFoldableRow("N/A").getTotalValue()).isEqualTo(7); assertThat(row1.getFoldableRow("N/A").getTotalValue()).isEqualTo(7);
assertThat(row1.getCells().length).isEqualTo(0); assertThat(row1.getCells()).isEmpty();
assertThat(row1.getFoldableRowCount()).isEqualTo(2); assertThat(row1.getFoldableRowCount()).isEqualTo(2);
FoldableRow<DetailedMonitorQueryItem> row2 = report.getRow("L20000"); FoldableRow<DetailedMonitorQueryItem> row2 = report.getRow("L20000");
assertThat(row2.getTotalValue()).isEqualTo(10); assertThat(row2.getTotalValue()).isEqualTo(10);
assertThat(row2.getFoldableRow("L22000").getTotalValue()).isEqualTo(4); assertThat(row2.getFoldableRow("L22000").getTotalValue()).isEqualTo(4);
assertThat(row2.getFoldableRow("N/A").getTotalValue()).isEqualTo(6); assertThat(row2.getFoldableRow("N/A").getTotalValue()).isEqualTo(6);
assertThat(row2.getCells().length).isEqualTo(0); assertThat(row2.getCells()).isEmpty();
assertThat(row2.getFoldableRowCount()).isEqualTo(2); assertThat(row2.getFoldableRowCount()).isEqualTo(2);
FoldableRow<DetailedMonitorQueryItem> row3 = report.getRow("L30000"); FoldableRow<DetailedMonitorQueryItem> row3 = report.getRow("L30000");
@ -150,19 +150,19 @@ class ProvideDetailedClassificationReportAccTest extends AbstractReportAccTest {
assertThat(row3.getFoldableRow("L33000").getTotalValue()).isEqualTo(3); assertThat(row3.getFoldableRow("L33000").getTotalValue()).isEqualTo(3);
assertThat(row3.getFoldableRow("L99000").getTotalValue()).isEqualTo(1); assertThat(row3.getFoldableRow("L99000").getTotalValue()).isEqualTo(1);
assertThat(row3.getFoldableRow("N/A").getTotalValue()).isEqualTo(3); assertThat(row3.getFoldableRow("N/A").getTotalValue()).isEqualTo(3);
assertThat(row3.getCells().length).isEqualTo(0); assertThat(row3.getCells()).isEmpty();
assertThat(row3.getFoldableRowCount()).isEqualTo(3); assertThat(row3.getFoldableRowCount()).isEqualTo(3);
FoldableRow<DetailedMonitorQueryItem> row4 = report.getRow("L40000"); FoldableRow<DetailedMonitorQueryItem> row4 = report.getRow("L40000");
assertThat(row4.getTotalValue()).isEqualTo(10); assertThat(row4.getTotalValue()).isEqualTo(10);
assertThat(row4.getFoldableRow("N/A").getTotalValue()).isEqualTo(10); assertThat(row4.getFoldableRow("N/A").getTotalValue()).isEqualTo(10);
assertThat(row4.getCells().length).isEqualTo(0); assertThat(row4.getCells()).isEmpty();
assertThat(row4.getFoldableRowCount()).isEqualTo(1); assertThat(row4.getFoldableRowCount()).isEqualTo(1);
FoldableRow<DetailedMonitorQueryItem> row5 = report.getRow("L50000"); FoldableRow<DetailedMonitorQueryItem> row5 = report.getRow("L50000");
assertThat(row5.getTotalValue()).isEqualTo(13); assertThat(row5.getTotalValue()).isEqualTo(13);
assertThat(row5.getFoldableRow("N/A").getTotalValue()).isEqualTo(13); assertThat(row5.getFoldableRow("N/A").getTotalValue()).isEqualTo(13);
assertThat(row5.getCells().length).isEqualTo(0); assertThat(row5.getCells()).isEmpty();
assertThat(row5.getFoldableRowCount()).isEqualTo(1); assertThat(row5.getFoldableRowCount()).isEqualTo(1);
assertThat(report.getSumRow().getTotalValue()).isEqualTo(50); assertThat(report.getSumRow().getTotalValue()).isEqualTo(50);

View File

@ -4,7 +4,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.ClobTypeHandler; import org.apache.ibatis.type.ClobTypeHandler;
@ -16,66 +15,58 @@ import pro.taskana.task.internal.models.TaskImpl;
public interface TaskTestMapper { public interface TaskTestMapper {
@Select("select CUSTOM_ATTRIBUTES from TASK where id = #{taskId}") @Select("select CUSTOM_ATTRIBUTES from TASK where id = #{taskId}")
@Results( @Result(
value = { property = "customAttributes",
@Result( column = "CUSTOM_ATTRIBUTES",
property = "customAttributes", javaType = String.class,
column = "CUSTOM_ATTRIBUTES", typeHandler = ClobTypeHandler.class)
javaType = String.class,
typeHandler = ClobTypeHandler.class)
})
String getCustomAttributesAsString(@Param("taskId") String taskId); String getCustomAttributesAsString(@Param("taskId") String taskId);
@Select( @Select(
"SELECT ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, CREATOR, DESCRIPTION, NOTE, PRIORITY, STATE, CLASSIFICATION_CATEGORY, CLASSIFICATION_KEY, CLASSIFICATION_ID, WORKBASKET_ID, WORKBASKET_KEY, DOMAIN, BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER, POR_COMPANY, POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, IS_READ, IS_TRANSFERRED, CUSTOM_ATTRIBUTES, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9, CUSTOM_10 " "SELECT ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, CREATOR, DESCRIPTION, NOTE, PRIORITY, STATE, CLASSIFICATION_CATEGORY, CLASSIFICATION_KEY, CLASSIFICATION_ID, WORKBASKET_ID, WORKBASKET_KEY, DOMAIN, BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER, POR_COMPANY, POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, IS_READ, IS_TRANSFERRED, CUSTOM_ATTRIBUTES, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9, CUSTOM_10 "
+ "FROM TASK " + "FROM TASK "
+ "WHERE CUSTOM_ATTRIBUTES like #{searchText}") + "WHERE CUSTOM_ATTRIBUTES like #{searchText}")
@Results( @Result(property = "id", column = "ID")
value = { @Result(property = "created", column = "CREATED")
@Result(property = "id", column = "ID"), @Result(property = "claimed", column = "CLAIMED")
@Result(property = "created", column = "CREATED"), @Result(property = "completed", column = "COMPLETED")
@Result(property = "claimed", column = "CLAIMED"), @Result(property = "modified", column = "MODIFIED")
@Result(property = "completed", column = "COMPLETED"), @Result(property = "planned", column = "PLANNED")
@Result(property = "modified", column = "MODIFIED"), @Result(property = "due", column = "DUE")
@Result(property = "planned", column = "PLANNED"), @Result(property = "name", column = "NAME")
@Result(property = "due", column = "DUE"), @Result(property = "creator", column = "CREATOR")
@Result(property = "name", column = "NAME"), @Result(property = "description", column = "DESCRIPTION")
@Result(property = "creator", column = "CREATOR"), @Result(property = "note", column = "NOTE")
@Result(property = "description", column = "DESCRIPTION"), @Result(property = "priority", column = "PRIORITY")
@Result(property = "note", column = "NOTE"), @Result(property = "state", column = "STATE")
@Result(property = "priority", column = "PRIORITY"), @Result(property = "classificationSummaryImpl.category", column = "CLASSIFICATION_CATEGORY")
@Result(property = "state", column = "STATE"), @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID")
@Result( @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY")
property = "classificationSummaryImpl.category", @Result(property = "domain", column = "DOMAIN")
column = "CLASSIFICATION_CATEGORY"), @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID")
@Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID")
@Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), @Result(property = "owner", column = "OWNER")
@Result(property = "domain", column = "DOMAIN"), @Result(property = "primaryObjRef.company", column = "POR_COMPANY")
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.system", column = "POR_SYSTEM")
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), @Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE")
@Result(property = "owner", column = "OWNER"), @Result(property = "primaryObjRef.type", column = "POR_TYPE")
@Result(property = "primaryObjRef.company", column = "POR_COMPANY"), @Result(property = "primaryObjRef.value", column = "POR_VALUE")
@Result(property = "primaryObjRef.system", column = "POR_SYSTEM"), @Result(property = "isRead", column = "IS_READ")
@Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE"), @Result(property = "isTransferred", column = "IS_TRANSFERRED")
@Result(property = "primaryObjRef.type", column = "POR_TYPE"), @Result(
@Result(property = "primaryObjRef.value", column = "POR_VALUE"), property = "customAttributes",
@Result(property = "isRead", column = "IS_READ"), column = "CUSTOM_ATTRIBUTES",
@Result(property = "isTransferred", column = "IS_TRANSFERRED"), javaType = Map.class,
@Result( typeHandler = MapTypeHandler.class)
property = "customAttributes", @Result(property = "custom1", column = "CUSTOM_1")
column = "CUSTOM_ATTRIBUTES", @Result(property = "custom2", column = "CUSTOM_2")
javaType = Map.class, @Result(property = "custom3", column = "CUSTOM_3")
typeHandler = MapTypeHandler.class), @Result(property = "custom4", column = "CUSTOM_4")
@Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom5", column = "CUSTOM_5")
@Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom6", column = "CUSTOM_6")
@Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom7", column = "CUSTOM_7")
@Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom8", column = "CUSTOM_8")
@Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom9", column = "CUSTOM_9")
@Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom10", column = "CUSTOM_10")
@Result(property = "custom7", column = "CUSTOM_7"),
@Result(property = "custom8", column = "CUSTOM_8"),
@Result(property = "custom9", column = "CUSTOM_9"),
@Result(property = "custom10", column = "CUSTOM_10")
})
List<TaskImpl> selectTasksByCustomAttributeLike(@Param("searchText") String searchText); List<TaskImpl> selectTasksByCustomAttributeLike(@Param("searchText") String searchText);
} }