提交 3a935b05 编写于 作者: J jurgen

Complex types value handler

上级 1e723e25
......@@ -39,10 +39,7 @@ public class JDBCReference implements DBDReference {
private DBSDataType type;
private Ref value;
private JDBCReference()
{
}
private Object refObject;
public JDBCReference(DBSDataType type, Ref value) throws DBCException
{
......@@ -77,13 +74,16 @@ public class JDBCReference implements DBDReference {
@Override
public Object getReferencedObject(DBCExecutionContext context) throws DBCException
{
try {
Object refValue = value.getObject();
DBDValueHandler valueHandler = DBUtils.findValueHandler(context, type);
return valueHandler.getValueFromObject(context, type, refValue, false);
} catch (SQLException e) {
throw new DBCException("Can't obtain object reference");
if (refObject == null) {
try {
Object refValue = value.getObject();
DBDValueHandler valueHandler = DBUtils.findValueHandler(context, type);
refObject = valueHandler.getValueFromObject(context, type, refValue, false);
} catch (SQLException e) {
throw new DBCException("Can't obtain object reference");
}
}
return refObject;
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册