|
@@ -1,5 +1,6 @@
|
|
package org.dbsyncer.connector.schema;
|
|
package org.dbsyncer.connector.schema;
|
|
|
|
|
|
|
|
+import org.dbsyncer.common.util.NumberUtil;
|
|
import org.dbsyncer.connector.AbstractValueMapper;
|
|
import org.dbsyncer.connector.AbstractValueMapper;
|
|
import org.dbsyncer.connector.ConnectorException;
|
|
import org.dbsyncer.connector.ConnectorException;
|
|
import org.dbsyncer.connector.ConnectorMapper;
|
|
import org.dbsyncer.connector.ConnectorMapper;
|
|
@@ -36,6 +37,10 @@ public class DecimalValueMapper extends AbstractValueMapper<BigDecimal> {
|
|
Boolean b = (Boolean) val;
|
|
Boolean b = (Boolean) val;
|
|
return new BigDecimal(b ? 1 : 0);
|
|
return new BigDecimal(b ? 1 : 0);
|
|
}
|
|
}
|
|
|
|
+ if (val instanceof String) {
|
|
|
|
+ String s = (String) val;
|
|
|
|
+ return new BigDecimal(NumberUtil.toInt(s));
|
|
|
|
+ }
|
|
throw new ConnectorException(String.format("%s can not find type [%s], val [%s]", getClass().getSimpleName(), val.getClass(), val));
|
|
throw new ConnectorException(String.format("%s can not find type [%s], val [%s]", getClass().getSimpleName(), val.getClass(), val));
|
|
}
|
|
}
|
|
}
|
|
}
|