Przeglądaj źródła

支持字符转byte[]

Signed-off-by: AE86 <836391306@qq.com>
AE86 2 lat temu
rodzic
commit
ffb61f248c

+ 4 - 0
dbsyncer-connector/src/main/java/org/dbsyncer/connector/schema/BinaryValueMapper.java

@@ -13,6 +13,10 @@ public class BinaryValueMapper extends AbstractValueMapper<byte[]> {
 
     @Override
     protected byte[] convert(ConnectorMapper connectorMapper, Object val) {
+        if(val instanceof String){
+            String s = (String) val;
+            return s.getBytes();
+        }
         throw new ConnectorException(String.format("%s can not find type [%s], val [%s]", getClass().getSimpleName(), val.getClass(), val));
     }
 }