use of org.teiid.translator.salesforce.execution.DeletedObject in project teiid by teiid.
the class SalesforceConnectionImpl method getDeleted.
public DeletedResult getDeleted(String objectName, Calendar startCalendar, Calendar endCalendar) throws ResourceException {
GetDeletedResult deleted;
try {
deleted = partnerConnection.getDeleted(objectName, startCalendar, endCalendar);
} catch (InvalidSObjectFault e) {
throw new ResourceException(e);
} catch (UnexpectedErrorFault e) {
throw new ResourceException(e);
} catch (ConnectionException e) {
throw new ResourceException(e);
}
DeletedResult result = new DeletedResult();
result.setLatestDateCovered(deleted.getLatestDateCovered());
result.setEarliestDateAvailable(deleted.getEarliestDateAvailable());
DeletedRecord[] records = deleted.getDeletedRecords();
List<DeletedObject> resultRecords = new ArrayList<DeletedObject>();
if (records != null) {
for (DeletedRecord record : records) {
DeletedObject object = new DeletedObject();
object.setID(record.getId());
object.setDeletedDate(record.getDeletedDate());
resultRecords.add(object);
}
}
result.setResultRecords(resultRecords);
return result;
}
Aggregations