CloudantClient 2.11을 사용하고 있습니다. 복잡한 키가있는보기를 만들었습니다. 클라이언트 API를 사용하여 뷰를 쿼리하려고합니다. 각 행 결과에 키와 반환 값이 있지만 행 .getKey()가 null을 반환하는 것을 볼 수 있습니다.()ComplexKey가있는 CloudantClient가 null 키를 반환합니다.
ViewResponse<ComplexKey, Integer> response = database.getViewRequestBuilder("view", "viewName").newRequest(Key.Type.COMPLEX, Integer.class).reduce(true)
.group(true).build().getResponse();
List<Row<ComplexKey, Integer>> rows = response.getRows();
for (Row<ComplexKey, Integer> row : rows) {
ComplexKey key = row.getKey();
Integer value = row.getValue();
}
문제가 row.getKey이다 내가 그것을 키 값을 가지고 볼 수 있지만 모든 방법 널 :
my database view and documents
내 코드는 다음과 같습니다.
도움말아씨 주셔서 감사합니다.
배열 키가 객체보다 선호되는 이유는 [이 발행물 주석] (https://github.com/cloudant/java-cloudant/issues/386#issuecomment-340009841)을 참조하십시오. – ricellis