提交 2846fefb authored 作者: Thomas Mueller's avatar Thomas Mueller

Component types are transferred over the network, but not persisted in the database file as of now.

上级 fc19e647
...@@ -393,8 +393,16 @@ public class Transfer { ...@@ -393,8 +393,16 @@ public class Transfer {
break; break;
} }
case Value.ARRAY: { case Value.ARRAY: {
Value[] list = ((ValueArray) v).getList(); ValueArray va = (ValueArray) v;
writeInt(list.length); Value[] list = va.getList();
int len = list.length;
Class<?> componentType = va.getComponentType();
if (componentType == Object.class) {
writeInt(len);
} else {
writeInt(-(len + 1));
writeString(componentType.getName());
}
for (Value value : list) { for (Value value : list) {
writeValue(value); writeValue(value);
} }
...@@ -511,11 +519,16 @@ public class Transfer { ...@@ -511,11 +519,16 @@ public class Transfer {
} }
case Value.ARRAY: { case Value.ARRAY: {
int len = readInt(); int len = readInt();
Class<?> componentType = Object.class;
if (len < 0) {
len = -(len + 1);
componentType = Utils.loadUserClass(readString());
}
Value[] list = new Value[len]; Value[] list = new Value[len];
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
list[i] = readValue(); list[i] = readValue();
} }
return ValueArray.get(list); return ValueArray.get(componentType, list);
} }
case Value.RESULT_SET: { case Value.RESULT_SET: {
SimpleResultSet rs = new SimpleResultSet(); SimpleResultSet rs = new SimpleResultSet();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论