Skip to content

Commit df9483c

Browse files
committed
MODWRKFLOW-54: Migrate to Spring-Boot 4.0.
This is the first pass at the migration.
1 parent e2a3f1a commit df9483c

45 files changed

Lines changed: 175 additions & 179 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
32

43
<modelVersion>4.0.0</modelVersion>
54

components/src/main/java/org/folio/rest/workflow/model/EmailTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import lombok.Setter;
99
import org.folio.rest.workflow.model.components.DelegateTask;
1010
import org.folio.rest.workflow.model.has.common.HasEmailTaskCommon;
11-
import org.springframework.lang.NonNull;
11+
import org.jspecify.annotations.NonNull;
1212

1313
@Entity
1414
public class EmailTask extends AbstractTask implements DelegateTask, HasEmailTaskCommon {

components/src/main/java/org/folio/rest/workflow/model/NodeInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import com.fasterxml.jackson.annotation.JsonSubTypes;
44
import com.fasterxml.jackson.annotation.JsonTypeInfo;
5-
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;
65
import org.folio.rest.workflow.model.resolver.DeserializeAsNodeJsonResolver;
6+
import tools.jackson.databind.annotation.JsonTypeIdResolver;
77

88
@JsonTypeIdResolver(DeserializeAsNodeJsonResolver.class)
99
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "deserializeAs")

components/src/main/java/org/folio/rest/workflow/model/Workflow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.folio.rest.workflow.model;
22

33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4-
import com.fasterxml.jackson.databind.JsonNode;
54
import jakarta.persistence.CollectionTable;
65
import jakarta.persistence.Column;
76
import jakarta.persistence.Convert;
@@ -33,6 +32,7 @@
3332
import org.folio.spring.domain.model.AbstractBaseEntity;
3433
import org.hibernate.annotations.ColumnDefault;
3534
import org.springframework.data.annotation.Version;
35+
import tools.jackson.databind.JsonNode;
3636

3737
@Entity
3838
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })

components/src/main/java/org/folio/rest/workflow/model/converter/AbstractConverter.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
package org.folio.rest.workflow.model.converter;
22

3-
import com.fasterxml.jackson.core.JsonProcessingException;
4-
import com.fasterxml.jackson.core.StreamReadFeature;
5-
import com.fasterxml.jackson.core.type.TypeReference;
6-
import com.fasterxml.jackson.databind.DeserializationFeature;
7-
import com.fasterxml.jackson.databind.MapperFeature;
8-
import com.fasterxml.jackson.databind.ObjectMapper;
9-
import com.fasterxml.jackson.databind.json.JsonMapper;
103
import jakarta.persistence.AttributeConverter;
4+
import tools.jackson.core.JacksonException;
5+
import tools.jackson.core.StreamReadFeature;
6+
import tools.jackson.core.type.TypeReference;
7+
import tools.jackson.databind.DeserializationFeature;
8+
import tools.jackson.databind.MapperFeature;
9+
import tools.jackson.databind.ObjectMapper;
10+
import tools.jackson.databind.json.JsonMapper;
1111

1212
/**
13-
* This converts the value into a JSON representation stored as a single string tin the database.
13+
* This converts the value into a JSON representation stored as a single string in the database.
14+
*
15+
* Implementations need only provide the T.
16+
* Each implementation is expected to be used as-is as a JSON string value without needing the type details.
1417
*/
1518
public abstract class AbstractConverter<T> implements AttributeConverter<T, String> {
1619

@@ -27,7 +30,7 @@ public String convertToDatabaseColumn(T attribute) {
2730

2831
try {
2932
return objectMapper.writeValueAsString(attribute);
30-
} catch (JsonProcessingException e) {
33+
} catch (JacksonException e) {
3134
throw new RuntimeException(e.getMessage());
3235
}
3336
}
@@ -38,11 +41,13 @@ public T convertToEntityAttribute(String dbData) {
3841

3942
try {
4043
return objectMapper.readValue(dbData, getTypeReference());
41-
} catch (JsonProcessingException e) {
44+
} catch (JacksonException e) {
4245
throw new RuntimeException(e.getMessage());
4346
}
4447
}
4548

46-
public abstract TypeReference<T> getTypeReference();
49+
public TypeReference<T> getTypeReference() {
50+
return new TypeReference<T>() {};
51+
}
4752

4853
}
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
package org.folio.rest.workflow.model.converter;
22

3-
import com.fasterxml.jackson.core.type.TypeReference;
43
import jakarta.persistence.Converter;
54
import java.util.List;
65
import org.folio.rest.workflow.dto.Comparison;
76

7+
/**
8+
* Comparison list converter.
9+
*/
810
@Converter
911
public class ComparisonListConverter extends AbstractConverter<List<Comparison>> {
1012

11-
@Override
12-
public TypeReference<List<Comparison>> getTypeReference() {
13-
return new TypeReference<List<Comparison>>() {};
14-
}
15-
1613
}
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.folio.rest.workflow.model.converter;
22

3-
import com.fasterxml.jackson.core.type.TypeReference;
43
import jakarta.persistence.Converter;
54
import org.folio.rest.workflow.model.EmbeddedVariable;
65

@@ -10,9 +9,4 @@
109
@Converter
1110
public class EmbeddedVariableConverter extends AbstractConverter<EmbeddedVariable> {
1211

13-
@Override
14-
public TypeReference<EmbeddedVariable> getTypeReference() {
15-
return new TypeReference<EmbeddedVariable>() {};
16-
}
17-
1812
}
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.folio.rest.workflow.model.converter;
22

3-
import com.fasterxml.jackson.core.type.TypeReference;
43
import jakarta.persistence.Converter;
54
import java.util.List;
65
import org.folio.rest.workflow.enums.InputAttribute;
@@ -11,9 +10,4 @@
1110
@Converter
1211
public class InputAttributeListConverter extends AbstractConverter<List<InputAttribute>> {
1312

14-
@Override
15-
public TypeReference<List<InputAttribute>> getTypeReference() {
16-
return new TypeReference<List<InputAttribute>>() {};
17-
}
18-
1913
}
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package org.folio.rest.workflow.model.converter;
22

3-
import com.fasterxml.jackson.core.type.TypeReference;
4-
import com.fasterxml.jackson.databind.JsonNode;
53
import jakarta.persistence.Converter;
4+
import tools.jackson.databind.JsonNode;
65

6+
/**
7+
* JSON Node converted.
8+
*/
79
@Converter
810
public class JsonNodeConverter extends AbstractConverter<JsonNode> {
911

10-
@Override
11-
public TypeReference<JsonNode> getTypeReference() {
12-
return new TypeReference<JsonNode>() {};
13-
}
14-
1512
}
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
package org.folio.rest.workflow.model.converter;
22

3-
import com.fasterxml.jackson.core.type.TypeReference;
43
import jakarta.persistence.Converter;
54
import java.util.List;
65
import org.folio.rest.workflow.dto.Mapping;
76

7+
/**
8+
* Mapping list converter.
9+
*/
810
@Converter
911
public class MappingListConverter extends AbstractConverter<List<Mapping>> {
1012

11-
@Override
12-
public TypeReference<List<Mapping>> getTypeReference() {
13-
return new TypeReference<List<Mapping>>() {};
14-
}
15-
1613
}

0 commit comments

Comments
 (0)