@Test public void id_and_name_mapped_to_version_table() { String docId = randomUUID().toString(); ObjectVersion<String> v1 = ObjectVersion.<String>builder() .changeset(mapOf( "name", "name", "id", 5l)) .build(); mappedDocumentStore.append(docId, ObjectVersionGraph.init(v1).getTip()); mappedDocumentStore.publish(); assertThat(mappedDocumentStore.getFullGraph(docId).getTip().getVersion()).isEqualTo(v1); long count = queryFactory.from(documentVersionProperty) .innerJoin(documentVersionProperty.documentVersionPropertyRevisionFk, documentVersion) .where(documentVersion.docId.eq(docId)) .fetchCount(); assertThat(count).isEqualTo(0); ObjectVersion<String> v2 = ObjectVersion.<String>builder() .parents(v1.revision) .build(); mappedDocumentStore.append(docId, ObjectVersionGraph.init(v1, v2).getTip()); mappedDocumentStore.publish(); count = queryFactory.from(documentVersion) .where(documentVersion.docId.eq(docId), documentVersion.revision.eq(v2.revision), documentVersion.name.eq("name"), documentVersion.id.eq(5l)) .fetchCount(); assertThat(count).isEqualTo(1); assertThat(mappedDocumentStore.getFullGraph(docId).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);  }