@SuppressWarnings("ReuseOfLocalVariable") @Test public void testUpdate() throws ApiException { List<PartnerSObject> initialQueryResults = this.conn.query("Select Name, Id from Opportunity").getSObjects(); assertTrue(initialQueryResults.size() > 1); SObject sObj = initialQueryResults.get(0); Id id = sObj.getId(); String origName = sObj.getField("Name"); sObj.setField("Name", origName + "xyz"); List<SObject> updateList = new ArrayList<SObject>(); updateList.add(sObj); List<SaveResult> updateResults = this.conn.update(updateList); assertEquals(1, updateList.size()); SaveResult result = updateResults.get(0); assertTrue(result.isSuccess()); assertEquals(0, result.getErrors().size()); assertEquals(id, result.getId()); List<PartnerSObject> postUpdateQueryResults = this.conn.query("Select Name, Id from Opportunity WHERE Id = '" + id.toString() + "'").getSObjects(); assertEquals(1, postUpdateQueryResults.size()); SObject postUpdateSObj = postUpdateQueryResults.get(0); assertEquals(origName + "xyz", postUpdateSObj.getField("Name")); postUpdateSObj.setField("Name", origName); updateList = new ArrayList<SObject>(); updateList.add(postUpdateSObj); this.conn.update(updateList); List<PartnerSObject> post2ndUpdateQueryResults = this.conn.query("Select Name, Id from Opportunity WHERE Id = '" + id.toString() + "'").getSObjects(); assertEquals(1, post2ndUpdateQueryResults.size()); SObject post2ndUpdateSObj = post2ndUpdateQueryResults.get(0); assertEquals(origName, post2ndUpdateSObj.getField("Name")); }
@Nonnull @Override public synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects) throws ApiException { logger.entry(sObjects); Update param = new Update(); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjectList = param.getSObjects(); writeSObjectsToStubSObjectList(sObjects, stubSObjectList); UpdateOp op = this.new UpdateOp(); UpdateResponse response = op.execute(param); List<SaveResult> results = new ArrayList<SaveResult>(); for (SaveResultType stubResult : response.getResult()) { results.add(new SaveResultImpl(stubResult)); } logger.exit(results); return results; }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects) throws ApiException { logger.entry(sObjects); Update param = new Update(); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjectList = param.getSObjects(); writeSObjectsToStubSObjectList(sObjects, stubSObjectList); UpdateOp op = this.new UpdateOp(); UpdateResponse response = op.execute(param); List<SaveResult> results = new ArrayList<SaveResult>(); for (SaveResultType stubResult : response.getResult()) { results.add(new SaveResultImpl(stubResult)); } logger.exit(results); return results; } }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects) throws ApiException { logger.entry(sObjects); Update param = new Update(); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjectList = param.getSObjects(); writeSObjectsToStubSObjectList(sObjects, stubSObjectList); UpdateOp op = this.new UpdateOp(); UpdateResponse response = op.execute(param); List<SaveResult> results = new ArrayList<SaveResult>(); for (SaveResultType stubResult : response.getResult()) { results.add(new SaveResultImpl(stubResult)); } logger.exit(results); return results; } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects) throws ApiException { logger.entry(sObjects); Update param = new Update(); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjectList = param.getSObjects(); writeSObjectsToStubSObjectList(sObjects, stubSObjectList); UpdateOp op = this.new UpdateOp(); UpdateResponse response = op.execute(param); List<SaveResult> results = new ArrayList<SaveResult>(); for (SaveResultType stubResult : response.getResult()) { results.add(new SaveResultImpl(stubResult)); } logger.exit(results); return results; } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override synchronized int count(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int count(@Nonnull String sObjectType); @Override synchronized int countAll(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int countAll(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<DeleteResult> delete(@Nonnull List<Id> ids); @Nonnull @Override synchronized DescribeGlobalResult describeGlobal(); @Nonnull @Override synchronized SObjectDescription describeSObject(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SObjectDescription> describeSObjects(@Nonnull List<String> sObjectTypes); @Nonnull @Override synchronized List<EmptyRecycleBinResult> emptyRecycleBin(@Nonnull List<Id> ids); @Nonnull @Override synchronized DateTime getServerTimestamp(); @Nonnull @Override synchronized UserInfo getUserInfo(); @Nonnull @Override synchronized PartnerQueryResult query(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryAll(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryMore(@Nonnull PartnerQueryLocator locator); @Nonnull @Override synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fieldList); @Nonnull @Override synchronized Map<Id, SObject> retrieveExtended(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fields,
            int maxFieldNameChunkSize); @Nonnull @Override synchronized List<UndeleteResult> undelete(@Nonnull List<Id> ids); @Nonnull @Override synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<UpsertResult> upsert(@Nonnull String externalIdFieldName, @Nonnull List<SObject> sObjects); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects) throws ApiException { logger.entry(sObjects); Update param = new Update(); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjectList = param.getSObjects(); writeSObjectsToStubSObjectList(sObjects, stubSObjectList); UpdateOp op = this.new UpdateOp(); UpdateResponse response = op.execute(param); List<SaveResult> results = new ArrayList<SaveResult>(); for (SaveResultType stubResult : response.getResult()) { results.add(new SaveResultImpl(stubResult)); } logger.exit(results); return results; } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override synchronized int count(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int count(@Nonnull String sObjectType); @Override synchronized int countAll(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int countAll(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<DeleteResult> delete(@Nonnull List<Id> ids); @Nonnull @Override synchronized DescribeGlobalResult describeGlobal(); @Nonnull @Override synchronized SObjectDescription describeSObject(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SObjectDescription> describeSObjects(@Nonnull List<String> sObjectTypes); @Nonnull @Override synchronized List<EmptyRecycleBinResult> emptyRecycleBin(@Nonnull List<Id> ids); @Nonnull @Override synchronized DateTime getServerTimestamp(); @Nonnull @Override synchronized UserInfo getUserInfo(); @Nonnull @Override synchronized PartnerQueryResult query(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryAll(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryMore(@Nonnull PartnerQueryLocator locator); @Nonnull @Override synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fieldList); @Nonnull @Override synchronized Map<Id, SObject> retrieveExtended(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fields,
            int maxFieldNameChunkSize); @Nonnull @Override synchronized List<UndeleteResult> undelete(@Nonnull List<Id> ids); @Nonnull @Override synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<UpsertResult> upsert(@Nonnull String externalIdFieldName, @Nonnull List<SObject> sObjects);  }