mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-30 03:03:13 +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.JDBCDataValue;
|
||||||
import ai.chat2db.spi.model.SQLDataValue;
|
import ai.chat2db.spi.model.SQLDataValue;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: zgq
|
* @author: zgq
|
||||||
* @date: 2024年07月07日 16:58
|
* @date: 2024年07月07日 16:58
|
||||||
@ -25,7 +27,11 @@ public class OracleLongRawProcessor extends DefaultValueProcessor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String convertJDBCValueStrByType(JDBCDataValue dataValue) {
|
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() {
|
public String getBlobHexString() {
|
||||||
byte[] bytes = getBytes();
|
byte[] bytes = getBytes();
|
||||||
if (Objects.isNull(bytes)) {
|
if (Objects.isNull(bytes)) {
|
||||||
return "NULL";
|
return null;
|
||||||
}
|
}
|
||||||
return BaseEncoding.base16().encode(bytes);
|
return BaseEncoding.base16().encode(bytes);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user