Skip to content

Commit f415522

Browse files
committed
修复tkmybatis序列化循环引用
修复tkmybatis序列化循环引用
1 parent 369f97f commit f415522

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

arex-instrumentation-foundation/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@
6666
<artifactId>zstd-jni</artifactId>
6767
<version>1.5.2-5</version>
6868
</dependency>
69+
70+
<dependency>
71+
<groupId>tk.mybatis</groupId>
72+
<artifactId>mapper-core</artifactId>
73+
<version>1.1.5</version>
74+
</dependency>
6975
</dependencies>
7076

7177
<build>

arex-instrumentation-foundation/src/main/java/io/arex/foundation/serializer/JacksonSerializer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.commons.lang3.time.FastDateFormat;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
26+
import tk.mybatis.mapper.entity.EntityTable;
2627

2728
import javax.xml.datatype.DatatypeFactory;
2829
import javax.xml.datatype.XMLGregorianCalendar;
@@ -168,6 +169,8 @@ private void configMapper() {
168169
MAPPER.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
169170
MAPPER.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true);
170171
MAPPER.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
172+
173+
MAPPER.addMixIn(EntityTable.class,IgnoreType.class);
171174
}
172175

173176
private void customTimeFormatSerializer(SimpleModule module) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package io.arex.foundation.serializer.ignore;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreType;
4+
5+
@JsonIgnoreType
6+
public class IgnoreType {
7+
}

0 commit comments

Comments
 (0)