TSK-358 Bulk update of all tasks with a specific ObjectReference

This commit is contained in:
BerndBreier 2018-03-16 08:27:13 +01:00 committed by Holger Hagen
parent df409eaa4e
commit eb55cb6ad8
18 changed files with 235 additions and 159 deletions

View File

@ -57,7 +57,7 @@ public class TaskanaProducersTest {
Class.forName("org.h2.Driver");
int resultCount = 0;
try (Connection conn = DriverManager.getConnection("jdbc:h2:~/taskana-h2-data/testdb;AUTO_SERVER=TRUE;IGNORECASE=TRUE", "SA", "SA")) {
try (Connection conn = DriverManager.getConnection("jdbc:h2:~/taskana-h2-data/testdb;AUTO_SERVER=TRUE;IGNORECASE=TRUE;LOCK_MODE=0", "SA", "SA")) {
ResultSet rs = conn.createStatement().executeQuery("SELECT ID, OWNER FROM TASK");
while (rs.next()) {
@ -74,7 +74,7 @@ public class TaskanaProducersTest {
Class.forName("org.h2.Driver");
int resultCount = 0;
try (Connection conn = DriverManager.getConnection("jdbc:h2:~/taskana-h2-data/testdb;AUTO_SERVER=TRUE;IGNORECASE=TRUE", "SA", "SA")) {
try (Connection conn = DriverManager.getConnection("jdbc:h2:~/taskana-h2-data/testdb;AUTO_SERVER=TRUE;IGNORECASE=TRUE;LOCK_MODE=0", "SA", "SA")) {
ResultSet rs = conn.createStatement().executeQuery("SELECT ID, OWNER FROM TASK");
while (rs.next()) {

View File

@ -5,7 +5,7 @@ swarm:
data-sources:
TestDS:
driver-name: myh2
connection-url: jdbc:h2:~/taskana-h2-data/testdb;AUTO_SERVER=TRUE
connection-url: jdbc:h2:~/taskana-h2-data/testdb;AUTO_SERVER=TRUE;IGNORECASE=TRUE;LOCK_MODE=0
user-name: SA
password: SA
jdbc-drivers:

View File

@ -23,7 +23,7 @@ public class TaskanaEngineConfiguration {
private static final String USER_NAME = "sa";
private static final String USER_PASSWORD = "sa";
private static final String JDBC_H2_MEM_TASKANA = "jdbc:h2:mem:taskana;IGNORECASE=TRUE";
private static final String JDBC_H2_MEM_TASKANA = "jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0";
private static final String H2_DRIVER = "org.h2.Driver";
private static final String TASKANA_ROLES_PROPERTIES = "/taskanaroles.properties";
private static final String TASKANA_PROPERTIES_SEPARATOR = "|";
@ -81,7 +81,7 @@ public class TaskanaEngineConfiguration {
public static DataSource createDefaultDataSource() {
LOGGER.warn("No datasource is provided. A inmemory db is used: "
+ "'org.h2.Driver', 'jdbc:h2:mem:taskana;IGNORECASE=TRUE', 'sa', 'sa'");
+ "'org.h2.Driver', 'jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0', 'sa', 'sa'");
return createDatasource(H2_DRIVER, JDBC_H2_MEM_TASKANA, USER_NAME, USER_PASSWORD);
}

View File

@ -27,9 +27,11 @@ public interface AttachmentMapper {
+ " #{att.objectReference.type}, #{att.objectReference.value}, #{att.channel}, #{att.received}, #{att.customAttributes,jdbcType=CLOB,javaType=java.util.Map,typeHandler=pro.taskana.impl.persistence.MapTypeHandler} )")
void insert(@Param("att") AttachmentImpl att);
@Select("SELECT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, CLASSIFICATION_ID, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED, CUSTOM_ATTRIBUTES "
@Select("<script> SELECT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, CLASSIFICATION_ID, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED, CUSTOM_ATTRIBUTES "
+ "FROM ATTACHMENT "
+ "WHERE TASK_ID = #{taskId}")
+ "WHERE TASK_ID = #{taskId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "taskId", column = "TASK_ID"),
@ -49,9 +51,11 @@ public interface AttachmentMapper {
})
List<AttachmentImpl> findAttachmentsByTaskId(@Param("taskId") String taskId);
@Select("SELECT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, CLASSIFICATION_ID, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED, CUSTOM_ATTRIBUTES "
@Select("<script> SELECT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, CLASSIFICATION_ID, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED, CUSTOM_ATTRIBUTES "
+ "FROM ATTACHMENT "
+ "WHERE ID = #{attachmentId}")
+ "WHERE ID = #{attachmentId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "taskId", column = "TASK_ID"),
@ -76,6 +80,7 @@ public interface AttachmentMapper {
+ "<where>"
+ "TASK_ID IN (<foreach collection='array' item='item' separator=',' >#{item}</foreach>)"
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@ -98,7 +103,9 @@ public interface AttachmentMapper {
+ " WHERE ID = #{id}")
void update(AttachmentImpl attachment);
@Select("select CUSTOM_ATTRIBUTES from attachment where id = #{attachmentId}")
@Select("<script> select CUSTOM_ATTRIBUTES from attachment where id = #{attachmentId}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "customAttributes", column = "CUSTOM_ATTRIBUTES", jdbcType = JdbcType.CLOB,
javaType = String.class, typeHandler = ClobTypeHandler.class)

View File

@ -18,10 +18,12 @@ import pro.taskana.impl.ClassificationSummaryImpl;
*/
public interface ClassificationMapper {
@Select("SELECT ID, KEY, PARENT_ID, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
@Select("<script> SELECT ID, KEY, PARENT_ID, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
+ "FROM CLASSIFICATION "
+ "WHERE KEY = #{key}"
+ "AND DOMAIN = #{domain}")
+ "AND DOMAIN = #{domain}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "parentId", column = "PARENT_ID"),
@ -46,9 +48,11 @@ public interface ClassificationMapper {
@Result(property = "custom8", column = "CUSTOM_8")})
ClassificationImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain);
@Select("SELECT ID, KEY, PARENT_ID, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
@Select("<script>SELECT ID, KEY, PARENT_ID, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
+ "FROM CLASSIFICATION "
+ "WHERE ID = #{id}")
+ "WHERE ID = #{id}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "parentId", column = "PARENT_ID"),
@ -91,7 +95,8 @@ public interface ClassificationMapper {
+ "FROM CLASSIFICATION "
+ "WHERE KEY = #{key} "
+ "AND DOMAIN = #{domain}"
+ "ORDER BY KEY DESC"
+ "ORDER BY KEY DESC "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -107,11 +112,14 @@ public interface ClassificationMapper {
+ "SELECT DOMAIN "
+ "FROM CLASSIFICATION "
+ "WHERE KEY = #{classification_key} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> getDomainsForClassification(@Param("classification_key") String classificationKey);
@Select("SELECT KEY "
@Select("<script>SELECT KEY "
+ "FROM CLASSIFICATION "
+ "WHERE PARENT_ID = #{parentId}")
+ "WHERE PARENT_ID = #{parentId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> getChildrenOfClassification(@Param("parentId") String parentId);
}

View File

@ -18,10 +18,14 @@ public interface DistributionTargetMapper {
@Delete("DELETE FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId} AND TARGET_ID = #{targetId}")
void delete(@Param("sourceId") String sourceId, @Param("targetId") String targetId);
@Select("SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId}")
@Select("<script>SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> findBySourceId(@Param("sourceId") String sourceId);
@Select("SELECT count(*) FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId} AND TARGET_ID = #{targetId}")
@Select("<script>SELECT count(*) FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId} AND TARGET_ID = #{targetId}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
int getNumberOfDistributionTargets(@Param("sourceId") String sourceId, @Param("targetId") String targetId);
@Delete("<script>DELETE FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId} AND TARGET_ID IN (<foreach item='target' collection='targetId' separator=',' > #{target} </foreach>)</script>")

View File

@ -16,9 +16,11 @@ import pro.taskana.impl.ObjectReference;
*/
public interface ObjectReferenceMapper {
@Select("SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
@Select("<script>SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
+ "FROM OBJECT_REFERENCE "
+ "ORDER BY ID")
+ "ORDER BY ID "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@Result(property = "company", column = "COMPANY"),
@ -28,9 +30,11 @@ public interface ObjectReferenceMapper {
@Result(property = "value", column = "VALUE") })
List<ObjectReference> findAll();
@Select("SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
@Select("<script>SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
+ "FROM OBJECT_REFERENCE "
+ "WHERE ID = #{id}")
+ "WHERE ID = #{id}"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@Result(property = "company", column = "COMPANY"),
@ -40,13 +44,15 @@ public interface ObjectReferenceMapper {
@Result(property = "value", column = "VALUE") })
ObjectReference findById(@Param("id") String id);
@Select("SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
@Select("<script>SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
+ "FROM OBJECT_REFERENCE "
+ "WHERE COMPANY = #{objectReference.company} "
+ "AND SYSTEM = #{objectReference.system} "
+ "AND SYSTEM_INSTANCE = #{objectReference.systemInstance} "
+ "AND TYPE = #{objectReference.type} "
+ "AND VALUE = #{objectReference.value}")
+ "AND VALUE = #{objectReference.value} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@Result(property = "company", column = "COMPANY"),

View File

@ -103,6 +103,7 @@ public interface QueryMapper {
+ "<if test='custom16Like != null'>AND (<foreach item='item' collection='custom16Like' separator=' OR '>UPPER(t.CUSTOM_10) LIKE #{item}</foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {@Result(property = "taskId", column = "ID"),
@Result(property = "created", column = "CREATED"),
@ -186,6 +187,7 @@ public interface QueryMapper {
+ "<if test='custom8Like != null'>AND (<foreach item='item' collection='custom8Like' separator=' OR ' > CUSTOM_8 LIKE #{item}</foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -207,6 +209,7 @@ public interface QueryMapper {
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
+ "<if test='value != null'>AND VALUE IN(<foreach item='item' collection='value' separator=',' >#{item}</foreach>)</if> "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@ -267,27 +270,28 @@ public interface QueryMapper {
+ "<if test = '!checkReadPermission'> "
+ "( "
+ "</if> "
+ "<if test=\"permission.name().equals('READ')\">a.MAX_READ</if> "
+ "<if test=\"permission.name().equals('OPEN')\">a.MAX_OPEN</if> "
+ "<if test=\"permission.name().equals('APPEND')\">a.MAX_APPEND</if>"
+ "<if test=\"permission.name().equals('TRANSFER')\">a.MAX_TRANSFER</if>"
+ "<if test=\"permission.name().equals('DISTRIBUTE')\">a.MAX_DISTRIBUTE</if>"
+ "<if test=\"permission.name().equals('CUSTOM_1')\">a.MAX_CUSTOM_1</if>"
+ "<if test=\"permission.name().equals('CUSTOM_2')\">a.MAX_CUSTOM_2</if>"
+ "<if test=\"permission.name().equals('CUSTOM_3')\">a.MAX_CUSTOM_3</if>"
+ "<if test=\"permission.name().equals('CUSTOM_4')\">a.MAX_CUSTOM_4</if>"
+ "<if test=\"permission.name().equals('CUSTOM_5')\">a.MAX_CUSTOM_5</if>"
+ "<if test=\"permission.name().equals('CUSTOM_6')\">a.MAX_CUSTOM_6</if>"
+ "<if test=\"permission.name().equals('CUSTOM_7')\">a.MAX_CUSTOM_7</if>"
+ "<if test=\"permission.name().equals('CUSTOM_8')\">a.MAX_CUSTOM_8</if>"
+ "<if test=\"permission.name().equals('CUSTOM_9')\">a.MAX_CUSTOM_9</if>"
+ "<if test=\"permission.name().equals('CUSTOM_10')\">a.MAX_CUSTOM_10</if>"
+ "<if test=\"permission.name().equals('CUSTOM_11')\">a.MAX_CUSTOM_11</if>"
+ "<if test=\"permission.name().equals('CUSTOM_12')\">a.MAX_CUSTOM_12</if> = 1 "
+ "<if test=\"permission.name() == 'READ'\">a.MAX_READ</if> "
+ "<if test=\"permission.name() == 'OPEN'\">a.MAX_OPEN</if> "
+ "<if test=\"permission.name() == 'APPEND'\">a.MAX_APPEND</if>"
+ "<if test=\"permission.name() == 'TRANSFER'\">a.MAX_TRANSFER</if>"
+ "<if test=\"permission.name() == 'DISTRIBUTE'\">a.MAX_DISTRIBUTE</if>"
+ "<if test=\"permission.name() == 'CUSTOM_1'\">a.MAX_CUSTOM_1</if>"
+ "<if test=\"permission.name() == 'CUSTOM_2'\">a.MAX_CUSTOM_2</if>"
+ "<if test=\"permission.name() == 'CUSTOM_3'\">a.MAX_CUSTOM_3</if>"
+ "<if test=\"permission.name() == 'CUSTOM_4'\">a.MAX_CUSTOM_4</if>"
+ "<if test=\"permission.name() == 'CUSTOM_5'\">a.MAX_CUSTOM_5</if>"
+ "<if test=\"permission.name() == 'CUSTOM_6'\">a.MAX_CUSTOM_6</if>"
+ "<if test=\"permission.name() == 'CUSTOM_7'\">a.MAX_CUSTOM_7</if>"
+ "<if test=\"permission.name() == 'CUSTOM_8'\">a.MAX_CUSTOM_8</if>"
+ "<if test=\"permission.name() == 'CUSTOM_9'\">a.MAX_CUSTOM_9</if>"
+ "<if test=\"permission.name() == 'CUSTOM_10'\">a.MAX_CUSTOM_10</if>"
+ "<if test=\"permission.name() == 'CUSTOM_11'\">a.MAX_CUSTOM_11</if>"
+ "<if test=\"permission.name() == 'CUSTOM_12'\">a.MAX_CUSTOM_12</if> = 1 "
+ "</if>)"
+ "</if>"
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@ -314,6 +318,7 @@ public interface QueryMapper {
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@ -413,6 +418,7 @@ public interface QueryMapper {
+ "<if test='custom16Like != null'>AND (<foreach item='item' collection='custom16Like' separator=' OR '>UPPER(t.CUSTOM_10) LIKE #{item}</foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
Long countQueryTasks(TaskQueryImpl taskQuery);
@ -451,6 +457,7 @@ public interface QueryMapper {
+ "<if test='custom8In != null'>AND CUSTOM_8 IN(<foreach item='item' collection='custom8In' separator=',' >#{item}</foreach>) </if> "
+ "<if test='custom8Like != null'>AND (<foreach item='item' collection='custom8Like' separator=' OR ' > CUSTOM_8 LIKE #{item}</foreach>)</if> "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
Long countQueryClassifications(ClassificationQueryImpl classificationQuery);
@ -462,6 +469,7 @@ public interface QueryMapper {
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
+ "<if test='value != null'>AND VALUE IN(<foreach item='item' collection='value' separator=',' >#{item}</foreach>)</if> "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
Long countQueryObjectReferences(ObjectReferenceQueryImpl objectReference);
@ -514,26 +522,27 @@ public interface QueryMapper {
+ "<if test = '!checkReadPermission'> "
+ "( "
+ "</if> "
+ "<if test=\"permission.name().equals('READ')\">a.MAX_READ</if> "
+ "<if test=\"permission.name().equals('OPEN')\">a.MAX_OPEN</if> "
+ "<if test=\"permission.name().equals('APPEND')\">a.MAX_APPEND</if>"
+ "<if test=\"permission.name().equals('TRANSFER')\">a.MAX_TRANSFER</if>"
+ "<if test=\"permission.name().equals('DISTRIBUTE')\">a.MAX_DISTRIBUTE</if>"
+ "<if test=\"permission.name().equals('CUSTOM_1')\">a.MAX_CUSTOM_1</if>"
+ "<if test=\"permission.name().equals('CUSTOM_2')\">a.MAX_CUSTOM_2</if>"
+ "<if test=\"permission.name().equals('CUSTOM_3')\">a.MAX_CUSTOM_3</if>"
+ "<if test=\"permission.name().equals('CUSTOM_4')\">a.MAX_CUSTOM_4</if>"
+ "<if test=\"permission.name().equals('CUSTOM_5')\">a.MAX_CUSTOM_5</if>"
+ "<if test=\"permission.name().equals('CUSTOM_6')\">a.MAX_CUSTOM_6</if>"
+ "<if test=\"permission.name().equals('CUSTOM_7')\">a.MAX_CUSTOM_7</if>"
+ "<if test=\"permission.name().equals('CUSTOM_8')\">a.MAX_CUSTOM_8</if>"
+ "<if test=\"permission.name().equals('CUSTOM_9')\">a.MAX_CUSTOM_9</if>"
+ "<if test=\"permission.name().equals('CUSTOM_10')\">a.MAX_CUSTOM_10</if>"
+ "<if test=\"permission.name().equals('CUSTOM_11')\">a.MAX_CUSTOM_11</if>"
+ "<if test=\"permission.name().equals('CUSTOM_12')\">a.MAX_CUSTOM_12</if> = 1 "
+ "<if test=\"permission.name() == 'READ'\">a.MAX_READ</if> "
+ "<if test=\"permission.name() == 'OPEN'\">a.MAX_OPEN</if> "
+ "<if test=\"permission.name() == 'APPEND'\">a.MAX_APPEND</if>"
+ "<if test=\"permission.name() == 'TRANSFER'\">a.MAX_TRANSFER</if>"
+ "<if test=\"permission.name() == 'DISTRIBUTE'\">a.MAX_DISTRIBUTE</if>"
+ "<if test=\"permission.name() == 'CUSTOM_1'\">a.MAX_CUSTOM_1</if>"
+ "<if test=\"permission.name() == 'CUSTOM_2'\">a.MAX_CUSTOM_2</if>"
+ "<if test=\"permission.name() == 'CUSTOM_3'\">a.MAX_CUSTOM_3</if>"
+ "<if test=\"permission.name() == 'CUSTOM_4'\">a.MAX_CUSTOM_4</if>"
+ "<if test=\"permission.name() == 'CUSTOM_5'\">a.MAX_CUSTOM_5</if>"
+ "<if test=\"permission.name() == 'CUSTOM_6'\">a.MAX_CUSTOM_6</if>"
+ "<if test=\"permission.name() == 'CUSTOM_7'\">a.MAX_CUSTOM_7</if>"
+ "<if test=\"permission.name() == 'CUSTOM_8'\">a.MAX_CUSTOM_8</if>"
+ "<if test=\"permission.name() == 'CUSTOM_9'\">a.MAX_CUSTOM_9</if>"
+ "<if test=\"permission.name() == 'CUSTOM_10'\">a.MAX_CUSTOM_10</if>"
+ "<if test=\"permission.name() == 'CUSTOM_11'\">a.MAX_CUSTOM_11</if>"
+ "<if test=\"permission.name() == 'CUSTOM_12'\">a.MAX_CUSTOM_12</if> = 1 "
+ "</if>)"
+ "</if>"
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
Long countQueryWorkbaskets(WorkbasketQueryImpl workbasketQuery);
@ -542,6 +551,7 @@ public interface QueryMapper {
+ "<if test='workbasketIdIn != null'>AND WORKBASKET_ID IN(<foreach item='item' collection='workbasketIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
Long countQueryWorkbasketAccessItems(WorkbasketAccessItemQueryImpl accessItem);
@ -621,6 +631,7 @@ public interface QueryMapper {
+ "<if test='custom16Like != null'>AND (<foreach item='item' collection='custom16Like' separator=' OR '>UPPER(t.CUSTOM_10) LIKE #{item}</foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> queryTaskColumnValues(TaskQueryImpl taskQuery);
@ -661,6 +672,7 @@ public interface QueryMapper {
+ "<if test='custom8Like != null'>AND (<foreach item='item' collection='custom8Like' separator=' OR ' > CUSTOM_8 LIKE #{item}</foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> queryClassificationColumnValues(ClassificationQueryImpl classificationQuery);
@ -673,6 +685,7 @@ public interface QueryMapper {
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
+ "<if test='value != null'>AND VALUE IN(<foreach item='item' collection='value' separator=',' >#{item}</foreach>)</if> "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> queryObjectReferenceColumnValues(ObjectReferenceQueryImpl objectReference);
@ -725,27 +738,28 @@ public interface QueryMapper {
+ "<if test = '!checkReadPermission'> "
+ "( "
+ "</if> "
+ "<if test=\"permission.name().equals('READ')\">a.MAX_READ</if> "
+ "<if test=\"permission.name().equals('OPEN')\">a.MAX_OPEN</if> "
+ "<if test=\"permission.name().equals('APPEND')\">a.MAX_APPEND</if>"
+ "<if test=\"permission.name().equals('TRANSFER')\">a.MAX_TRANSFER</if>"
+ "<if test=\"permission.name().equals('DISTRIBUTE')\">a.MAX_DISTRIBUTE</if>"
+ "<if test=\"permission.name().equals('CUSTOM_1')\">a.MAX_CUSTOM_1</if>"
+ "<if test=\"permission.name().equals('CUSTOM_2')\">a.MAX_CUSTOM_2</if>"
+ "<if test=\"permission.name().equals('CUSTOM_3')\">a.MAX_CUSTOM_3</if>"
+ "<if test=\"permission.name().equals('CUSTOM_4')\">a.MAX_CUSTOM_4</if>"
+ "<if test=\"permission.name().equals('CUSTOM_5')\">a.MAX_CUSTOM_5</if>"
+ "<if test=\"permission.name().equals('CUSTOM_6')\">a.MAX_CUSTOM_6</if>"
+ "<if test=\"permission.name().equals('CUSTOM_7')\">a.MAX_CUSTOM_7</if>"
+ "<if test=\"permission.name().equals('CUSTOM_8')\">a.MAX_CUSTOM_8</if>"
+ "<if test=\"permission.name().equals('CUSTOM_9')\">a.MAX_CUSTOM_9</if>"
+ "<if test=\"permission.name().equals('CUSTOM_10')\">a.MAX_CUSTOM_10</if>"
+ "<if test=\"permission.name().equals('CUSTOM_11')\">a.MAX_CUSTOM_11</if>"
+ "<if test=\"permission.name().equals('CUSTOM_12')\">a.MAX_CUSTOM_12</if> = 1 "
+ "<if test=\"permission.name() == 'READ'\">a.MAX_READ</if> "
+ "<if test=\"permission.name() == 'OPEN'\">a.MAX_OPEN</if> "
+ "<if test=\"permission.name() == 'APPEND'\">a.MAX_APPEND</if>"
+ "<if test=\"permission.name() == 'TRANSFER'\">a.MAX_TRANSFER</if>"
+ "<if test=\"permission.name() == 'DISTRIBUTE'\">a.MAX_DISTRIBUTE</if>"
+ "<if test=\"permission.name() == 'CUSTOM_1'\">a.MAX_CUSTOM_1</if>"
+ "<if test=\"permission.name() == 'CUSTOM_2'\">a.MAX_CUSTOM_2</if>"
+ "<if test=\"permission.name() == 'CUSTOM_3'\">a.MAX_CUSTOM_3</if>"
+ "<if test=\"permission.name() == 'CUSTOM_4'\">a.MAX_CUSTOM_4</if>"
+ "<if test=\"permission.name() == 'CUSTOM_5'\">a.MAX_CUSTOM_5</if>"
+ "<if test=\"permission.name() == 'CUSTOM_6'\">a.MAX_CUSTOM_6</if>"
+ "<if test=\"permission.name() == 'CUSTOM_7'\">a.MAX_CUSTOM_7</if>"
+ "<if test=\"permission.name() == 'CUSTOM_8'\">a.MAX_CUSTOM_8</if>"
+ "<if test=\"permission.name() == 'CUSTOM_9'\">a.MAX_CUSTOM_9</if>"
+ "<if test=\"permission.name() == 'CUSTOM_10'\">a.MAX_CUSTOM_10</if>"
+ "<if test=\"permission.name() == 'CUSTOM_11'\">a.MAX_CUSTOM_11</if>"
+ "<if test=\"permission.name() == 'CUSTOM_12'\">a.MAX_CUSTOM_12</if> = 1 "
+ "</if>)"
+ "</if>"
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> queryWorkbasketColumnValues(WorkbasketQueryImpl workbasketQuery);
@ -757,6 +771,7 @@ public interface QueryMapper {
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> queryWorkbasketAccessItemColumnValues(WorkbasketAccessItemQueryImpl accessItemQuery);
}

View File

@ -24,10 +24,12 @@ import pro.taskana.impl.persistence.MapTypeHandler;
*/
public interface TaskMapper {
@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, "
@Select("<script>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, CUSTOM_11, CUSTOM_12, CUSTOM_13, CUSTOM_14, CUSTOM_15, CUSTOM_16 "
+ "FROM TASK "
+ "WHERE ID = #{id}")
+ "WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "created", column = "CREATED"),
@ -108,11 +110,13 @@ public interface TaskMapper {
@Delete("<script>DELETE FROM TASK WHERE ID IN(<foreach item='item' collection='ids' separator=',' >#{item}</foreach>)</script>")
void deleteMultiple(@Param("ids") List<String> ids);
@Select("SELECT ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, CREATOR, DESCRIPTION, 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, "
@Select("<script>SELECT ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, CREATOR, DESCRIPTION, 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, CUSTOM_11, CUSTOM_12, CUSTOM_13, CUSTOM_14, CUSTOM_15, CUSTOM_16 "
+ "FROM TASK "
+ "WHERE WORKBASKET_KEY = #{workbasketSummaryImpl.key} and DOMAIN = #{workbasketSummaryImpl.domain "
+ "AND STATE = #{taskState}")
+ "AND STATE = #{taskState} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "taskId", column = "ID"),
@Result(property = "created", column = "CREATED"),
@ -179,6 +183,7 @@ public interface TaskMapper {
@Select("<script>SELECT ID, STATE, WORKBASKET_KEY FROM TASK "
+ "WHERE ID IN(<foreach item='item' collection='taskIds' separator=',' >#{item}</foreach>) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "taskId", column = "ID"),

View File

@ -42,11 +42,12 @@ public interface TaskMonitorMapper {
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "WORKBASKET_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks") })
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfWorkbaskets(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@ -78,11 +79,12 @@ public interface TaskMonitorMapper {
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CLASSIFICATION_CATEGORY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks") })
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfCategories(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@ -114,11 +116,12 @@ public interface TaskMonitorMapper {
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CLASSIFICATION_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks") })
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfClassifications(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@ -150,12 +153,13 @@ public interface TaskMonitorMapper {
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "TASK_CLASSIFICATION_KEY", property = "key"),
@Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks") })
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<DetailedMonitorQueryItem> getTaskCountOfDetailedClassifications(
@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@ -188,11 +192,12 @@ public interface TaskMonitorMapper {
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY ${customField}, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY ${customField}, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CUSTOM_FIELD", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks") })
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfCustomFieldValues(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@ -231,6 +236,7 @@ public interface TaskMonitorMapper {
+ "</if> "
+ "</foreach>) "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> getTaskIdsOfCategoriesBySelectedItems(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,

View File

@ -18,8 +18,10 @@ import pro.taskana.impl.WorkbasketAccessItemImpl;
*/
public interface WorkbasketAccessMapper {
@Select("SELECT ID, WORKBASKET_ID, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8, PERM_CUSTOM_9, PERM_CUSTOM_10, PERM_CUSTOM_11, PERM_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST WHERE ID = #{id}")
@Select("<script>SELECT ID, WORKBASKET_ID, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8, PERM_CUSTOM_9, PERM_CUSTOM_10, PERM_CUSTOM_11, PERM_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@ -43,8 +45,10 @@ public interface WorkbasketAccessMapper {
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")})
WorkbasketAccessItemImpl findById(@Param("id") String id);
@Select("SELECT ID, WORKBASKET_ID, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8, PERM_CUSTOM_9, PERM_CUSTOM_10, PERM_CUSTOM_11, PERM_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST WHERE WORKBASKET_ID = #{id}")
@Select("<script>SELECT ID, WORKBASKET_ID, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8, PERM_CUSTOM_9, PERM_CUSTOM_10, PERM_CUSTOM_11, PERM_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST WHERE WORKBASKET_ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@ -89,7 +93,8 @@ public interface WorkbasketAccessMapper {
@Select("<script>SELECT MAX(PERM_READ) AS P_READ, MAX(PERM_OPEN) AS P_OPEN, MAX(PERM_APPEND) AS P_APPEND, MAX(PERM_TRANSFER) AS P_TRANSFER, MAX(PERM_DISTRIBUTE) AS P_DISTRIBUTE, MAX(PERM_CUSTOM_1) AS P_CUSTOM_1, MAX(PERM_CUSTOM_2) AS P_CUSTOM_2, MAX(PERM_CUSTOM_3) AS P_CUSTOM_3, MAX(PERM_CUSTOM_4) AS P_CUSTOM_4, MAX(PERM_CUSTOM_5) AS P_CUSTOM_5, MAX(PERM_CUSTOM_6) AS P_CUSTOM_6, MAX(PERM_CUSTOM_7) AS P_CUSTOM_7, MAX(PERM_CUSTOM_8) AS P_CUSTOM_8, MAX(PERM_CUSTOM_9) AS P_CUSTOM_9, MAX(PERM_CUSTOM_10) AS P_CUSTOM_10, MAX(PERM_CUSTOM_11) AS P_CUSTOM_11, MAX(PERM_CUSTOM_12) AS P_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST "
+ "WHERE WORKBASKET_ID = #{workbasketId} "
+ "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> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@ -135,7 +140,9 @@ public interface WorkbasketAccessMapper {
+ "<if test=\"authorization == 'CUSTOM_9'\">a.PERM_CUSTOM_9</if>"
+ "<if test=\"authorization == 'CUSTOM_10'\">a.PERM_CUSTOM_10</if>"
+ "<if test=\"authorization == 'CUSTOM_11'\">a.PERM_CUSTOM_11</if>"
+ "<if test=\"authorization == 'CUSTOM_12'\">a.PERM_CUSTOM_12</if> = 1</script>")
+ "<if test=\"authorization == 'CUSTOM_12'\">a.PERM_CUSTOM_12</if> = 1 "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@ -181,7 +188,9 @@ public interface WorkbasketAccessMapper {
+ "<if test=\"authorization == 'CUSTOM_9'\">PERM_CUSTOM_9</if>"
+ "<if test=\"authorization == 'CUSTOM_10'\">PERM_CUSTOM_10</if>"
+ "<if test=\"authorization == 'CUSTOM_11'\">PERM_CUSTOM_11</if>"
+ "<if test=\"authorization == 'CUSTOM_12'\">PERM_CUSTOM_12</if> = 1</script>")
+ "<if test=\"authorization == 'CUSTOM_12'\">PERM_CUSTOM_12</if> = 1 "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<WorkbasketAccessItemImpl> findByWorkbasketAndAccessIdAndAuthorizationsById(
@Param("workbasketId") String workbasketId, @Param("accessIds") List<String> accessIds,
@Param("authorization") String authorization);

View File

@ -20,7 +20,9 @@ import pro.taskana.impl.WorkbasketSummaryImpl;
*/
public interface WorkbasketMapper {
@Select("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 FROM WORKBASKET WHERE ID = #{id}")
@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 FROM WORKBASKET WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "created", column = "CREATED"),
@ -40,7 +42,9 @@ public interface WorkbasketMapper {
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
WorkbasketImpl findById(@Param("id") String id);
@Select("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 FROM WORKBASKET WHERE KEY = #{key} and DOMAIN = #{domain}")
@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 FROM WORKBASKET WHERE KEY = #{key} and DOMAIN = #{domain} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "created", column = "CREATED"),
@ -60,7 +64,9 @@ public interface WorkbasketMapper {
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
WorkbasketImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain);
@Select("SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, 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})")
@Select("<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, 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> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -75,8 +81,10 @@ public interface WorkbasketMapper {
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummaryImpl> findByDistributionTargets(@Param("id") String id);
@Select("SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET "
+ " WHERE ID IN (SELECT SOURCE_ID FROM DISTRIBUTION_TARGETS WHERE TARGET_ID = #{id})")
@Select("<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET "
+ " WHERE ID IN (SELECT SOURCE_ID FROM DISTRIBUTION_TARGETS WHERE TARGET_ID = #{id}) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -91,7 +99,9 @@ public interface WorkbasketMapper {
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummaryImpl> findDistributionSources(@Param("id") String id);
@Select("SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID = #{id}")
@Select("<script>SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID = #{id} "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -106,7 +116,9 @@ public interface WorkbasketMapper {
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummaryImpl> findSummaryById(@Param("key") String id);
@Select("SELECT * FROM WORKBASKET ORDER BY id")
@Select("<script>SELECT * FROM WORKBASKET ORDER BY id "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -142,7 +154,9 @@ public interface WorkbasketMapper {
+ "<if test=\"permission.name() == 'CUSTOM_10'\">PERM_CUSTOM_10</if>"
+ "<if test=\"permission.name() == 'CUSTOM_11'\">PERM_CUSTOM_11</if>"
+ "<if test=\"permission.name() == 'CUSTOM_12'\">PERM_CUSTOM_12</if> = 1 </foreach> "
+ "ORDER BY id</script>")
+ "ORDER BY id "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -159,7 +173,9 @@ public interface WorkbasketMapper {
List<WorkbasketSummaryImpl> findByPermission(@Param("permissions") List<WorkbasketPermission> permissions,
@Param("accessId") String accessId);
@Insert("INSERT INTO WORKBASKET (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) VALUES (#{workbasket.id}, #{workbasket.key}, #{workbasket.created}, #{workbasket.modified}, #{workbasket.name}, #{workbasket.domain}, #{workbasket.type}, #{workbasket.description}, #{workbasket.owner}, #{workbasket.custom1}, #{workbasket.custom2}, #{workbasket.custom3}, #{workbasket.custom4}, #{workbasket.orgLevel1}, #{workbasket.orgLevel2}, #{workbasket.orgLevel3}, #{workbasket.orgLevel4})")
@Insert("<script>INSERT INTO WORKBASKET (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) VALUES (#{workbasket.id}, #{workbasket.key}, #{workbasket.created}, #{workbasket.modified}, #{workbasket.name}, #{workbasket.domain}, #{workbasket.type}, #{workbasket.description}, #{workbasket.owner}, #{workbasket.custom1}, #{workbasket.custom2}, #{workbasket.custom3}, #{workbasket.custom4}, #{workbasket.orgLevel1}, #{workbasket.orgLevel2}, #{workbasket.orgLevel3}, #{workbasket.orgLevel4}) "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Options(keyProperty = "id", keyColumn = "ID")
void insert(@Param("workbasket") WorkbasketImpl workbasket);

View File

@ -77,12 +77,12 @@ public class TaskanaEngineConfigurationTest {
*/
private static DataSource createDefaultDataSource() {
// JdbcDataSource ds = new JdbcDataSource();
// ds.setURL("jdbc:h2:mem:taskana;IGNORECASE=TRUE");
// ds.setURL("jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0");
// ds.setPassword("sa");
// ds.setUser("sa");
String jdbcDriver = "org.h2.Driver";
String jdbcUrl = "jdbc:h2:mem:taskana;IGNORECASE=TRUE";
String jdbcUrl = "jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0";
String dbUserName = "sa";
String dbPassword = "sa";
DataSource ds = new PooledDataSource(Thread.currentThread().getContextClassLoader(), jdbcDriver,

View File

@ -1,30 +1,30 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<tx:annotation-driven transaction-manager="transactionManager" />
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:task-engine;DB_CLOSE_DELAY=1000" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
</property>
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:task-engine;DB_CLOSE_DELAY=1000;IGNORECASE=TRUE;LOCK_MODE=0" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="taskanaEngineConfiguration" class="pro.taskana.configuration.SpringTaskanaEngineConfiguration">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="taskanaEngineConfiguration" class="pro.taskana.configuration.SpringTaskanaEngineConfiguration">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="taskanaEngine" factory-bean="taskanaEngineConfiguration" factory-method="buildTaskanaEngine" />
<bean id="taskService" factory-bean="taskanaEngine" factory-method="getTaskService" />
</beans>
<bean id="taskanaEngine" factory-bean="taskanaEngineConfiguration" factory-method="buildTaskanaEngine" />
<bean id="taskService" factory-bean="taskanaEngine" factory-method="getTaskService" />
</beans>

View File

@ -7,7 +7,7 @@ spring.h2.console.enabled=true
security.basic.enabled=false
######## Postkorb / Taskana DB #######
postkorb.datasource.url=jdbc:h2:mem:testdb
postkorb.datasource.url=jdbc:h2:mem:testdb;IGNORECASE=TRUE;LOCK_MODE=0
#postkorb.datasource.url=jdbc:h2:mem:testdb;TRACE_LEVEL_FIle=4
postkorb.datasource.schema=classpath:schema.sql
postkorb.datasource.driverClassName=org.h2.Driver

View File

@ -40,7 +40,7 @@ public class TransactionTest {
@Before
public void init() throws SQLException, ClassNotFoundException {
Class.forName("org.h2.Driver");
try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:task-engine;IGNORECASE=TRUE", "SA", "SA")) {
try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:task-engine;IGNORECASE=TRUE;LOCK_MODE=0", "SA", "SA")) {
conn.createStatement().executeUpdate("DELETE FROM TASK WHERE 1=1");
conn.commit();
}
@ -52,7 +52,7 @@ public class TransactionTest {
restTemplate.getForEntity("http://127.0.0.1:" + port + "/test", String.class);
int resultCount = 0;
try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:task-engine;IGNORECASE=TRUE", "SA", "SA")) {
try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:task-engine;IGNORECASE=TRUE;LOCK_MODE=0", "SA", "SA")) {
ResultSet rs = conn.createStatement().executeQuery("SELECT ID FROM TASK");
while (rs.next()) {
@ -69,7 +69,7 @@ public class TransactionTest {
restTemplate.postForEntity("http://127.0.0.1:" + port + "/test", null, String.class);
int resultCount = 0;
try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:task-engine;IGNORECASE=TRUE", "SA", "SA")) {
try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:task-engine;IGNORECASE=TRUE;LOCK_MODE=0", "SA", "SA")) {
ResultSet rs = conn.createStatement().executeQuery("SELECT ID FROM TASK");
while (rs.next()) {

View File

@ -1,35 +1,35 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<tx:annotation-driven transaction-manager="transactionManager" />
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:task-engine;DB_CLOSE_DELAY=1000" />
<property name="username" value="SA" />
<property name="password" value="SA" />
</bean>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:task-engine;DB_CLOSE_DELAY=1000;IGNORECASE=TRUE;LOCK_MODE=0" />
<property name="username" value="SA" />
<property name="password" value="SA" />
</bean>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="taskEngineConfiguration" class="pro.taskana.SpringTaskEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
</bean>
<bean id="taskEngineConfiguration" class="pro.taskana.SpringTaskEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
</bean>
<bean id="taskEngine" factory-bean="taskEngineConfiguration" factory-method="createTaskEngineConfiguration" />
<bean id="taskService" factory-bean="taskEngine" factory-method="getTaskService" />
<bean id="taskEngine" factory-bean="taskEngineConfiguration" factory-method="createTaskEngineConfiguration" />
<bean id="taskService" factory-bean="taskEngine" factory-method="getTaskService" />
<bean class="pro.taskana.TaskanaComponent" />
</beans>
<bean class="pro.taskana.TaskanaComponent" />
</beans>

View File

@ -1,6 +1,6 @@
logging.level.pro.taskana=DEBUG
######## Taskana DB #######
datasource.url=jdbc:h2:mem:taskana;IGNORECASE=TRUE
datasource.url=jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0
datasource.driverClassName=org.h2.Driver
datasource.username=sa
datasource.password=sa
datasource.password=sa