mirror of
https://gitee.com/dromara/dbswitch.git
synced 2025-09-04 11:25:44 +00:00
代码测试修正
This commit is contained in:
@@ -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:
|
||||
|
@@ -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")
|
||||
|
@@ -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)
|
||||
|
@@ -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")
|
||||
|
@@ -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)
|
||||
|
@@ -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")
|
||||
|
@@ -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:
|
||||
|
@@ -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:
|
||||
|
@@ -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:
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user