package frame.file;
|
|
import com.alibaba.druid.sql.ast.statement.SQLCommentStatement.Type;
|
|
import frame.data.meta.EntityMeta;
|
|
public class IOMappingItemRuntime {
|
private IOMappingItem item;
|
private String fromField;
|
private int fromIndex;
|
private String fromType;
|
private String toField;
|
private int toIndex;
|
private String toType;
|
|
public IOMappingItemRuntime(IOMappingItem ioMappingItem, String fromField, EntityMeta fromFieldMeta, String toField, EntityMeta toFieldMeta) {
|
item = ioMappingItem;
|
this.fromField = fromField == null ? null : fromField.toLowerCase();
|
|
if (fromFieldMeta != null) {
|
fromIndex = fromFieldMeta.getFieldCount();
|
fromType = fromFieldMeta.getName();
|
}
|
else {
|
fromIndex = -1;
|
fromType = null;
|
}
|
|
//2. set to
|
this.toField = toField == null ? null : toField.toLowerCase();
|
|
if (toFieldMeta != null) {
|
toIndex = toFieldMeta.getIndex();
|
toType = toFieldMeta.getType();
|
}
|
else {
|
toIndex = -1;
|
toType = null;
|
}
|
}
|
|
}
|