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