代码测试修正

This commit is contained in:
inrgihc
2023-11-20 22:45:47 +08:00
parent f90c2a13a5
commit a18e21c4c1
10 changed files with 22 additions and 14 deletions

View File

@@ -28,7 +28,7 @@ mybatis:
lazy-loading-enabled: true
aggressive-lazy-loading: false
map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
dbswitch:
configuration:

View File

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.dbswitch.admin.handler.ListPatternHandler;
import com.gitee.dbswitch.admin.handler.ListTypeHandler;
import com.gitee.dbswitch.common.entity.PatternMapper;
import com.gitee.dbswitch.common.type.CaseConvertEnum;
@@ -30,7 +31,7 @@ import org.apache.ibatis.type.EnumTypeHandler;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("DBSWITCH_ASSIGNMENT_CONFIG")
@TableName(value = "DBSWITCH_ASSIGNMENT_CONFIG", autoResultMap = true)
public class AssignmentConfigEntity {
@TableId(value = "id", type = IdType.AUTO)
@@ -66,10 +67,10 @@ public class AssignmentConfigEntity {
@TableField(value = "column_name_case", typeHandler = EnumTypeHandler.class)
private CaseConvertEnum columnNameCase;
@TableField(value = "table_name_map")
@TableField(value = "table_name_map", typeHandler = ListPatternHandler.class)
private List<PatternMapper> tableNameMap;
@TableField(value = "column_name_map")
@TableField(value = "column_name_map", typeHandler = ListPatternHandler.class)
private List<PatternMapper> columnNameMap;
@TableField("target_drop_table")

View File

@@ -19,6 +19,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;
@Data
@Builder
@@ -48,7 +49,7 @@ public class AssignmentJobEntity {
@TableField("status")
private Integer status;
@TableField("error_log")
@TableField(value = "error_log", jdbcType = JdbcType.LONGVARCHAR, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
private String errorLog;
@TableField(value = "create_time", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)

View File

@@ -21,12 +21,13 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.EnumTypeHandler;
import org.apache.ibatis.type.JdbcType;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("DBSWITCH_ASSIGNMENT_TASK")
@TableName(value = "DBSWITCH_ASSIGNMENT_TASK", autoResultMap = true)
public class AssignmentTaskEntity {
@TableId(value = "id", type = IdType.AUTO)
@@ -35,13 +36,13 @@ public class AssignmentTaskEntity {
@TableField("name")
private String name;
@TableField("description")
@TableField(value = "description")
private String description;
@TableField(value = "schedule_mode", typeHandler = EnumTypeHandler.class)
private ScheduleModeEnum scheduleMode;
@TableField("cron_expression")
@TableField(value = "cron_expression", jdbcType = JdbcType.LONGVARCHAR, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
private String cronExpression;
@TableField("published")

View File

@@ -26,7 +26,7 @@ import org.apache.ibatis.type.EnumTypeHandler;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("DBSWITCH_DATABASE_CONNECTION")
@TableName(value = "DBSWITCH_DATABASE_CONNECTION", autoResultMap = true)
public class DatabaseConnectionEntity {
@TableId(value = "id", type = IdType.AUTO)

View File

@@ -19,6 +19,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;
@Data
@Builder
@@ -54,7 +55,7 @@ public class SystemLogEntity {
@TableField("failed")
private Boolean failed;
@TableField("exception")
@TableField(value = "exception", jdbcType = JdbcType.LONGVARCHAR, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
private String exception;
@TableField("elapse_seconds")

View File

@@ -28,7 +28,7 @@ mybatis:
lazy-loading-enabled: true
aggressive-lazy-loading: false
map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
dbswitch:
configuration:

View File

@@ -28,7 +28,7 @@ mybatis:
lazy-loading-enabled: true
aggressive-lazy-loading: false
map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
dbswitch:
configuration:

View File

@@ -28,7 +28,7 @@ mybatis:
lazy-loading-enabled: true
aggressive-lazy-loading: false
map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
dbswitch:
configuration:

View File

@@ -73,7 +73,11 @@ public class MongodbTableDataWriteProvider extends DefaultTableDataWriteProvider
for (Object[] row : recordValues) {
Map<String, Object> columns = new LinkedHashMap<>(fieldCount);
for (int i = 0; i < fieldCount; ++i) {
columns.put(fieldNames.get(i), row[i]);
if (row[i] != null && row[i].getClass().getName().equals("org.bson.types.ObjectId")) {
columns.put(fieldNames.get(i), String.valueOf(row[i]));
} else {
columns.put(fieldNames.get(i), row[i]);
}
}
rows.add(columns);
}