@Test public void load_multiple_documents() { String docId1 = randomUUID().toString(); String docId2 = randomUUID().toString(); Map<PropertyPath, Object> props1 = mapOf("id", docId1); Map<PropertyPath, Object> props2 = mapOf("id", docId2); ObjectVersion<String> v1 = ObjectVersion.<String>builder().changeset(props1).build(); ObjectVersion<String> v2 = ObjectVersion.<String>builder().changeset(props2).build(); documentStore.append(docId1, ObjectVersionGraph.init(v1).getTip()); documentStore.append(docId2, ObjectVersionGraph.init(v2).getTip()); documentStore.publish(); GraphResults<String, String> results = documentStore.getGraphs(asList(docId1, docId2)); assertThat(results.getDocIds()).isEqualTo(ImmutableSet.of(docId1, docId2)); assertThat(results.latestRevision).isEqualTo(v2.revision); assertThat(results.getVersionGraph(docId1).getTip().getVersion()).isEqualTo(v1); assertThat(results.getVersionGraph(docId2).getTip().getVersion()).isEqualTo(v2); }
public void append(Id docId, VersionNode<PropertyPath, Object, M> version) { options.transactions.writeRequired(() -> { doAppend(ImmutableMultimap.of(docId, version)); return null; }); }
DocumentVersionStoreJdbc extends AbstractVersionStoreJdbc<Id, M, V, DocumentUpdateBatch<Id, M, V>, DocumentStoreOptions<Id, M, V>> { public void append(Id docId, VersionNode<PropertyPath, Object, M> version) { options.transactions.writeRequired(() -> { doAppend(ImmutableMultimap.of(docId, version)); return null; }); } }
DocumentVersionStoreJdbc extends AbstractVersionStoreJdbc<Id, M, V, DocumentUpdateBatch<Id, M, V>, DocumentStoreOptions<Id, M, V>> { public void append(Id docId, VersionNode<PropertyPath, Object, M> version) { options.transactions.writeRequired(() -> { doAppend(ImmutableMultimap.of(docId, version)); return null; }); } @SuppressWarnings("unused")  DocumentVersionStoreJdbc();  DocumentVersionStoreJdbc(DocumentStoreOptions<Id, M, V> options); }
DocumentVersionStoreJdbc extends AbstractVersionStoreJdbc<Id, M, V, DocumentUpdateBatch<Id, M, V>, DocumentStoreOptions<Id, M, V>> { public void append(Id docId, VersionNode<PropertyPath, Object, M> version) { options.transactions.writeRequired(() -> { doAppend(ImmutableMultimap.of(docId, version)); return null; }); } @SuppressWarnings("unused")  DocumentVersionStoreJdbc();  DocumentVersionStoreJdbc(DocumentStoreOptions<Id, M, V> options); void append(Id docId, VersionNode<PropertyPath, Object, M> version); void append(Id docId, Iterable<VersionNode<PropertyPath, Object, M>> versions); void append(Multimap<Id, VersionNode<PropertyPath, Object, M>> versionsByDocId); @Override DocumentUpdateBatch<Id, M, V> updateBatch(Collection<Id> ids); }
DocumentVersionStoreJdbc extends AbstractVersionStoreJdbc<Id, M, V, DocumentUpdateBatch<Id, M, V>, DocumentStoreOptions<Id, M, V>> { public void append(Id docId, VersionNode<PropertyPath, Object, M> version) { options.transactions.writeRequired(() -> { doAppend(ImmutableMultimap.of(docId, version)); return null; }); } @SuppressWarnings("unused")  DocumentVersionStoreJdbc();  DocumentVersionStoreJdbc(DocumentStoreOptions<Id, M, V> options); void append(Id docId, VersionNode<PropertyPath, Object, M> version); void append(Id docId, Iterable<VersionNode<PropertyPath, Object, M>> versions); void append(Multimap<Id, VersionNode<PropertyPath, Object, M>> versionsByDocId); @Override DocumentUpdateBatch<Id, M, V> updateBatch(Collection<Id> ids);  }