如何使用 Java 中的 TableAPI 从 Oracle NoSQL 表中获取所有行?我可以通过主键值获取记录。例子:
TableAPI tableH = kvstore.getTableAPI();
Table myTable = tableH.getTable("myTable");
PrimaryKey key = myTable.createPrimaryKey();
key.put("item", "Hat");
List<Row> myRows = null;
try {
myRows = tableH.multiGet(key, null, null);
} catch (ConsistencyException ce) {
} catch (RequestTimeoutException re) {
}
for (Row theRow: myRows) {
String itemType = theRow.get("item").asString().get();
}
System.out.println(itemType);
但我无法获得主键值。