mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-29 18:53:12 +08:00
fix(chat2db): fix oracle long raw null
This commit is contained in:
@ -5,6 +5,8 @@ import ai.chat2db.spi.jdbc.DefaultValueProcessor;
|
||||
import ai.chat2db.spi.model.JDBCDataValue;
|
||||
import ai.chat2db.spi.model.SQLDataValue;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author: zgq
|
||||
* @date: 2024年07月07日 16:58
|
||||
@ -25,7 +27,11 @@ public class OracleLongRawProcessor extends DefaultValueProcessor {
|
||||
|
||||
@Override
|
||||
public String convertJDBCValueStrByType(JDBCDataValue dataValue) {
|
||||
return EasyStringUtils.quoteString(dataValue.getBlobHexString());
|
||||
String blobHexString = dataValue.getBlobHexString();
|
||||
if (Objects.isNull(blobHexString)) {
|
||||
return "NULL";
|
||||
}
|
||||
return EasyStringUtils.quoteString(blobHexString);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class JDBCDataValue {
|
||||
public String getBlobHexString() {
|
||||
byte[] bytes = getBytes();
|
||||
if (Objects.isNull(bytes)) {
|
||||
return "NULL";
|
||||
return null;
|
||||
}
|
||||
return BaseEncoding.base16().encode(bytes);
|
||||
}
|
||||
|
Reference in New Issue
Block a user