@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.spanner.v1.Mutation getDefaultInstanceForType() { return com.google.spanner.v1.Mutation.getDefaultInstance(); }
result = result && getOperationCase().equals(other.getOperationCase()); if (!result) return false; switch (operationCase_) { case 1: result = result && getInsert().equals(other.getInsert()); break; case 2: result = result && getUpdate().equals(other.getUpdate()); break; case 3: result = result && getInsertOrUpdate().equals(other.getInsertOrUpdate()); break; case 4: result = result && getReplace().equals(other.getReplace()); break; case 5: result = result && getDelete().equals(other.getDelete()); break; case 0:
hash = (19 * hash) + getDescriptor().hashCode(); switch (operationCase_) { case 1: hash = (37 * hash) + INSERT_FIELD_NUMBER; hash = (53 * hash) + getInsert().hashCode(); break; case 2: hash = (37 * hash) + UPDATE_FIELD_NUMBER; hash = (53 * hash) + getUpdate().hashCode(); break; case 3: hash = (37 * hash) + INSERT_OR_UPDATE_FIELD_NUMBER; hash = (53 * hash) + getInsertOrUpdate().hashCode(); break; case 4: hash = (37 * hash) + REPLACE_FIELD_NUMBER; hash = (53 * hash) + getReplace().hashCode(); break; case 5: hash = (37 * hash) + DELETE_FIELD_NUMBER; hash = (53 * hash) + getDelete().hashCode(); break; case 0:
@java.lang.Override public com.google.spanner.v1.Mutation buildPartial() { com.google.spanner.v1.Mutation result = new com.google.spanner.v1.Mutation(this); if (operationCase_ == 1) { if (insertBuilder_ == null) {
public Builder mergeFrom(com.google.spanner.v1.Mutation other) { if (other == com.google.spanner.v1.Mutation.getDefaultInstance()) return this; switch (other.getOperationCase()) { case INSERT: mergeInsert(other.getInsert()); break; mergeUpdate(other.getUpdate()); break; mergeInsertOrUpdate(other.getInsertOrUpdate()); break; mergeReplace(other.getReplace()); break; mergeDelete(other.getDelete()); break;
out.add(proto.build()); proto = com.google.spanner.v1.Mutation.newBuilder(); com.google.spanner.v1.Mutation.Delete.Builder delete = proto.getDeleteBuilder().setTable(mutation.table); out.add(proto.build()); proto = com.google.spanner.v1.Mutation.newBuilder(); switch (mutation.operation) { case INSERT:
/** * * * <pre> * The mutations to be executed when this transaction commits. All * mutations are applied atomically, in the order they appear in * this list. * </pre> * * <code>repeated .google.spanner.v1.Mutation mutations = 4;</code> */ public com.google.spanner.v1.Mutation.Builder addMutationsBuilder(int index) { return getMutationsFieldBuilder() .addBuilder(index, com.google.spanner.v1.Mutation.getDefaultInstance()); } /**
@Test public void writeAtLeastOnce() throws ParseException { String timestampString = "2015-10-01T10:54:20.021Z"; ArgumentCaptor<CommitRequest> commit = ArgumentCaptor.forClass(CommitRequest.class); CommitResponse response = CommitResponse.newBuilder().setCommitTimestamp(Timestamps.parse(timestampString)).build(); Mockito.when(rpc.commit(commit.capture(), Mockito.eq(options))).thenReturn(response); Timestamp timestamp = session.writeAtLeastOnce( Arrays.asList(Mutation.newInsertBuilder("T").set("C").to("x").build())); assertThat(timestamp.getSeconds()) .isEqualTo(utcTimeSeconds(2015, Calendar.OCTOBER, 1, 10, 54, 20)); assertThat(timestamp.getNanos()).isEqualTo(TimeUnit.MILLISECONDS.toNanos(21)); CommitRequest request = commit.getValue(); assertThat(request.getSingleUseTransaction()).isNotNull(); assertThat(request.getSingleUseTransaction().getReadWrite()).isNotNull(); com.google.spanner.v1.Mutation mutation = com.google.spanner.v1.Mutation.newBuilder() .setInsert( Write.newBuilder() .setTable("T") .addColumns("C") .addValues( ListValue.newBuilder() .addValues(com.google.protobuf.Value.newBuilder().setStringValue("x")))) .build(); assertThat(request.getMutationsList()).containsExactly(mutation); }
/** * * * <pre> * The mutations to be executed when this transaction commits. All * mutations are applied atomically, in the order they appear in * this list. * </pre> * * <code>repeated .google.spanner.v1.Mutation mutations = 4;</code> */ public com.google.spanner.v1.Mutation.Builder addMutationsBuilder() { return getMutationsFieldBuilder() .addBuilder(com.google.spanner.v1.Mutation.getDefaultInstance()); } /**
out.add(proto.build()); proto = com.google.spanner.v1.Mutation.newBuilder(); com.google.spanner.v1.Mutation.Delete.Builder delete = proto.getDeleteBuilder().setTable(mutation.table); out.add(proto.build()); proto = com.google.spanner.v1.Mutation.newBuilder(); switch (mutation.operation) { case INSERT:
com.google.spanner.v1.Mutation.getDefaultInstance(); proto.add(existingProto);