TSK-1365: Removed HistoryCustomField enums for classification/workbasket
This commit is contained in:
parent
67d082a42d
commit
8b3013d602
|
@ -7,12 +7,12 @@ import org.apache.ibatis.session.RowBounds;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import pro.taskana.classification.api.ClassificationCustomField;
|
||||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryCustomField;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
|
||||
|
||||
public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuery {
|
||||
|
@ -181,7 +181,7 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
|
||||
@Override
|
||||
public ClassificationHistoryQuery customAttributeIn(
|
||||
ClassificationHistoryCustomField customField, String... searchArguments) {
|
||||
ClassificationCustomField customField, String... searchArguments) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
custom1In = toUpperCopy(searchArguments);
|
||||
|
@ -287,7 +287,7 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
|
||||
@Override
|
||||
public ClassificationHistoryQuery customAttributeLike(
|
||||
ClassificationHistoryCustomField customField, String... searchArguments) {
|
||||
ClassificationCustomField customField, String... searchArguments) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
custom1Like = toUpperCopy(searchArguments);
|
||||
|
|
|
@ -12,8 +12,8 @@ import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
|||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryCustomField;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
|
||||
import pro.taskana.workbasket.api.WorkbasketCustomField;
|
||||
|
||||
public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||
|
||||
|
@ -283,7 +283,7 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
|
||||
@Override
|
||||
public WorkbasketHistoryQuery customAttributeIn(
|
||||
WorkbasketHistoryCustomField customField, String... searchArguments) {
|
||||
WorkbasketCustomField customField, String... searchArguments) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
custom1In = toUpperCopy(searchArguments);
|
||||
|
@ -305,7 +305,7 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
|
||||
@Override
|
||||
public WorkbasketHistoryQuery customAttributeLike(
|
||||
WorkbasketHistoryCustomField customField, String... searchArguments) {
|
||||
WorkbasketCustomField customField, String... searchArguments) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
custom1Like = toUpperCopy(searchArguments);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package pro.taskana.simplehistory.impl.classification;
|
||||
|
||||
import pro.taskana.classification.api.ClassificationCustomField;
|
||||
import pro.taskana.common.api.BaseQuery;
|
||||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryCustomField;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
|
||||
|
||||
/** HistoryQuery for generating dynamic sql. */
|
||||
|
@ -139,7 +139,7 @@ public interface ClassificationHistoryQuery
|
|||
* @return the query
|
||||
*/
|
||||
ClassificationHistoryQuery customAttributeIn(
|
||||
ClassificationHistoryCustomField customField, String... searchArguments);
|
||||
ClassificationCustomField customField, String... searchArguments);
|
||||
|
||||
/**
|
||||
* Add your eventType to your query. It will be compared in SQL with an LIKE. If you use a
|
||||
|
@ -259,7 +259,7 @@ public interface ClassificationHistoryQuery
|
|||
* @return the query
|
||||
*/
|
||||
ClassificationHistoryQuery customAttributeLike(
|
||||
ClassificationHistoryCustomField customField, String... searchArguments);
|
||||
ClassificationCustomField customField, String... searchArguments);
|
||||
|
||||
/**
|
||||
* Sort the query result by eventType.
|
||||
|
|
|
@ -3,8 +3,8 @@ package pro.taskana.simplehistory.impl.workbasket;
|
|||
import pro.taskana.common.api.BaseQuery;
|
||||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryCustomField;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
|
||||
import pro.taskana.workbasket.api.WorkbasketCustomField;
|
||||
|
||||
/** HistoryQuery for generating dynamic sql. */
|
||||
public interface WorkbasketHistoryQuery
|
||||
|
@ -123,7 +123,7 @@ public interface WorkbasketHistoryQuery
|
|||
* @return the query
|
||||
*/
|
||||
WorkbasketHistoryQuery customAttributeIn(
|
||||
WorkbasketHistoryCustomField customField, String... searchArguments);
|
||||
WorkbasketCustomField customField, String... searchArguments);
|
||||
|
||||
/**
|
||||
* Add the values of custom attributes for pattern matching to your query. They will be compared
|
||||
|
@ -135,7 +135,7 @@ public interface WorkbasketHistoryQuery
|
|||
* @return the query
|
||||
*/
|
||||
WorkbasketHistoryQuery customAttributeLike(
|
||||
WorkbasketHistoryCustomField customField, String... searchArguments);
|
||||
WorkbasketCustomField customField, String... searchArguments);
|
||||
|
||||
/**
|
||||
* Add your workbasketId to your query. It will be compared in SQL with an LIKE. If you use a
|
||||
|
|
|
@ -9,12 +9,12 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import pro.taskana.classification.api.ClassificationCustomField;
|
||||
import pro.taskana.common.api.BaseQuery.SortDirection;
|
||||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.simplehistory.impl.SimpleHistoryServiceImpl;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryCustomField;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEventType;
|
||||
|
||||
|
@ -57,7 +57,7 @@ class QueryClassificationHistoryAccTest extends AbstractAccTest {
|
|||
.createClassificationHistoryQuery()
|
||||
.eventTypeIn(ClassificationHistoryEventType.UPDATED.getName())
|
||||
.domainLike("%A")
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_1, "otherCustom1")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_1, "otherCustom1")
|
||||
.orderByCreated(SortDirection.DESCENDING);
|
||||
|
||||
List<ClassificationHistoryEvent> results = query.list();
|
||||
|
@ -190,56 +190,56 @@ class QueryClassificationHistoryAccTest extends AbstractAccTest {
|
|||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_1, "custom1")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_1, "custom1")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(6);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_2, "custom2")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_2, "custom2")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(6);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_3, "otherCustom3")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_3, "otherCustom3")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_4, "custom4", "otherCustom4")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_4, "custom4", "otherCustom4")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(11);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_5, "custom5")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_5, "custom5")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(6);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_6, "custom6")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_6, "custom6")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(6);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_7, "otherCustom7")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_7, "otherCustom7")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeIn(ClassificationHistoryCustomField.CUSTOM_8, "custom8", "otherCustom8")
|
||||
.customAttributeIn(ClassificationCustomField.CUSTOM_8, "custom8", "otherCustom8")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(11);
|
||||
}
|
||||
|
@ -292,56 +292,56 @@ class QueryClassificationHistoryAccTest extends AbstractAccTest {
|
|||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_1, "other%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_1, "other%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_2, "cu%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_2, "cu%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(6);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_3, "other%", "cu%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_3, "other%", "cu%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(11);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_4, "other%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_4, "other%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_5, "cu%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_5, "cu%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(6);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_6, "other%", "cu%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_6, "other%", "cu%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(11);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_7, "other%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_7, "other%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
.customAttributeLike(ClassificationHistoryCustomField.CUSTOM_8, "other%", "cu%")
|
||||
.customAttributeLike(ClassificationCustomField.CUSTOM_8, "other%", "cu%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(11);
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@ import pro.taskana.common.api.TimeInterval;
|
|||
import pro.taskana.simplehistory.impl.SimpleHistoryServiceImpl;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryCustomField;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEventType;
|
||||
import pro.taskana.workbasket.api.WorkbasketCustomField;
|
||||
|
||||
/** Test for Workbasket History queries. */
|
||||
class QueryWorkbasketHistoryAccTest extends AbstractAccTest {
|
||||
|
@ -56,7 +56,7 @@ class QueryWorkbasketHistoryAccTest extends AbstractAccTest {
|
|||
.createWorkbasketHistoryQuery()
|
||||
.eventTypeIn(WorkbasketHistoryEventType.CREATED.getName())
|
||||
.domainLike("%A")
|
||||
.customAttributeIn(WorkbasketHistoryCustomField.CUSTOM_1, "otherCustom1")
|
||||
.customAttributeIn(WorkbasketCustomField.CUSTOM_1, "otherCustom1")
|
||||
.orderByCreated(SortDirection.DESCENDING);
|
||||
|
||||
List<WorkbasketHistoryEvent> results = query.list();
|
||||
|
@ -153,28 +153,28 @@ class QueryWorkbasketHistoryAccTest extends AbstractAccTest {
|
|||
returnValues =
|
||||
historyService
|
||||
.createWorkbasketHistoryQuery()
|
||||
.customAttributeIn(WorkbasketHistoryCustomField.CUSTOM_1, "custom1")
|
||||
.customAttributeIn(WorkbasketCustomField.CUSTOM_1, "custom1")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createWorkbasketHistoryQuery()
|
||||
.customAttributeIn(WorkbasketHistoryCustomField.CUSTOM_2, "custom2")
|
||||
.customAttributeIn(WorkbasketCustomField.CUSTOM_2, "custom2")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createWorkbasketHistoryQuery()
|
||||
.customAttributeIn(WorkbasketHistoryCustomField.CUSTOM_3, "custom3")
|
||||
.customAttributeIn(WorkbasketCustomField.CUSTOM_3, "custom3")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
returnValues =
|
||||
historyService
|
||||
.createWorkbasketHistoryQuery()
|
||||
.customAttributeIn(WorkbasketHistoryCustomField.CUSTOM_4, "custom4")
|
||||
.customAttributeIn(WorkbasketCustomField.CUSTOM_4, "custom4")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
|
@ -222,7 +222,7 @@ class QueryWorkbasketHistoryAccTest extends AbstractAccTest {
|
|||
returnValues =
|
||||
historyService
|
||||
.createWorkbasketHistoryQuery()
|
||||
.customAttributeLike(WorkbasketHistoryCustomField.CUSTOM_1, "other%")
|
||||
.customAttributeLike(WorkbasketCustomField.CUSTOM_1, "other%")
|
||||
.list();
|
||||
assertThat(returnValues).hasSize(5);
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package pro.taskana.spi.history.api.events.classification;
|
||||
|
||||
public enum ClassificationHistoryCustomField {
|
||||
CUSTOM_1,
|
||||
CUSTOM_2,
|
||||
CUSTOM_3,
|
||||
CUSTOM_4,
|
||||
CUSTOM_5,
|
||||
CUSTOM_6,
|
||||
CUSTOM_7,
|
||||
CUSTOM_8
|
||||
}
|
|
@ -63,7 +63,7 @@ public class ClassificationHistoryEvent {
|
|||
this.details = details;
|
||||
}
|
||||
|
||||
public void setCustomAttribute(ClassificationHistoryCustomField customField, String value) {
|
||||
public void setCustomAttribute(ClassificationCustomField customField, String value) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
custom1 = value;
|
||||
|
@ -94,7 +94,7 @@ public class ClassificationHistoryEvent {
|
|||
}
|
||||
}
|
||||
|
||||
public String getCustomAttribute(ClassificationHistoryCustomField customField) {
|
||||
public String getCustomAttribute(ClassificationCustomField customField) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
return custom1;
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package pro.taskana.spi.history.api.events.workbasket;
|
||||
|
||||
public enum WorkbasketHistoryCustomField {
|
||||
CUSTOM_1,
|
||||
CUSTOM_2,
|
||||
CUSTOM_3,
|
||||
CUSTOM_4
|
||||
}
|
|
@ -51,7 +51,7 @@ public class WorkbasketHistoryEvent {
|
|||
orgLevel4 = workbasket.getOrgLevel4();
|
||||
}
|
||||
|
||||
public void setCustomAttribute(WorkbasketHistoryCustomField customField, String value) {
|
||||
public void setCustomAttribute(WorkbasketCustomField customField, String value) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
custom1 = value;
|
||||
|
@ -70,7 +70,7 @@ public class WorkbasketHistoryEvent {
|
|||
}
|
||||
}
|
||||
|
||||
public String getCustomAttribute(WorkbasketHistoryCustomField customField) {
|
||||
public String getCustomAttribute(WorkbasketCustomField customField) {
|
||||
switch (customField) {
|
||||
case CUSTOM_1:
|
||||
return custom1;
|
||||
|
|
Loading…
Reference in New Issue