提交 6c182e4c authored 作者: Noel Grandin's avatar Noel Grandin

marker interfaces in Value are useless

and removing them exposes a bug in DataType.getTypeFromClass, which we can't fix right now
上级 c3e89b0c
......@@ -214,7 +214,7 @@ public class Recover extends Tool implements DataHandler {
/**
* INTERNAL
*/
public static Value.ValueBlob readBlobDb(Connection conn, long lobId,
public static ValueLobDb readBlobDb(Connection conn, long lobId,
long precision) {
DataHandler h = ((JdbcConnection) conn).getSession().getDataHandler();
verifyPageStore(h);
......@@ -235,7 +235,7 @@ public class Recover extends Tool implements DataHandler {
/**
* INTERNAL
*/
public static Value.ValueClob readClobDb(Connection conn, long lobId,
public static ValueLobDb readClobDb(Connection conn, long lobId,
long precision) {
DataHandler h = ((JdbcConnection) conn).getSession().getDataHandler();
verifyPageStore(h);
......
......@@ -995,10 +995,11 @@ public class DataType {
return Value.DECIMAL;
} else if (ResultSet.class.isAssignableFrom(x)) {
return Value.RESULT_SET;
} else if (Value.ValueBlob.class.isAssignableFrom(x)) {
} else if (ValueLobDb.class.isAssignableFrom(x)) {
return Value.BLOB;
} else if (Value.ValueClob.class.isAssignableFrom(x)) {
return Value.CLOB;
// FIXME no way to distinguish between these 2 types
// } else if (ValueLobDb.class.isAssignableFrom(x)) {
// return Value.CLOB;
} else if (Date.class.isAssignableFrom(x)) {
return Value.DATE;
} else if (Time.class.isAssignableFrom(x)) {
......
......@@ -1395,18 +1395,4 @@ public abstract class Value {
return null;
}
/**
* A "binary large object".
*/
public interface ValueClob {
// this is a marker interface
}
/**
* A "character large object".
*/
public interface ValueBlob {
// this is a marker interface
}
}
......@@ -39,8 +39,7 @@ import org.h2.util.Utils;
* Small objects are kept in memory and stored in the record.
* Large objects are either stored in the database, or in temporary files.
*/
public class ValueLobDb extends Value implements Value.ValueClob,
Value.ValueBlob {
public class ValueLobDb extends Value {
/**
* the value type (Value.BLOB or CLOB)
......
......@@ -265,8 +265,9 @@ public class TestValue extends TestDb {
testDataType(Value.NULL, Void.class);
testDataType(Value.DECIMAL, BigDecimal.class);
testDataType(Value.RESULT_SET, ResultSet.class);
testDataType(Value.BLOB, Value.ValueBlob.class);
testDataType(Value.CLOB, Value.ValueClob.class);
testDataType(Value.BLOB, ValueLobDb.class);
// see FIXME in DataType.getTypeFromClass
//testDataType(Value.CLOB, Value.ValueClob.class);
testDataType(Value.DATE, Date.class);
testDataType(Value.TIME, Time.class);
testDataType(Value.TIMESTAMP, Timestamp.class);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论