• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GetUpdatedResult类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.sforce.soap.partner.GetUpdatedResult的典型用法代码示例。如果您正苦于以下问题:Java GetUpdatedResult类的具体用法?Java GetUpdatedResult怎么用?Java GetUpdatedResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

GetUpdatedResult类属于com.sforce.soap.partner包,在下文中一共展示了GetUpdatedResult类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: splitIds

点赞 3

import com.sforce.soap.partner.GetUpdatedResult; //导入依赖的package包/类
/**
 * It can be passed a maximum of 2000 object IDs to the retrieve() call.
 * Need to split it into different arrays when objects are more than 2000
 */
protected List<String[]> splitIds(GetUpdatedResult result) throws IOException {
    List<String[]> idsList = new ArrayList<>();
    String[] ids = getRecordIds(result);
    if (ids.length == 0) {
        return idsList;
    } else if (ids.length <= MAXIMUM_RETRIEVE) {
        idsList.add(ids);
    } else {
        int size = ids.length / MAXIMUM_RETRIEVE;
        if (ids.length % MAXIMUM_RETRIEVE != 0) {
            size += 1;
        }
        for (int i = 0; i < size; i++) {
            idsList.add(ArrayUtils.subarray(ids, i * MAXIMUM_RETRIEVE, (i + 1) * MAXIMUM_RETRIEVE));
        }
    }
    return idsList;
}
 

开发者ID:Talend,
项目名称:components,
代码行数:23,
代码来源:SalesforceGetUpdatedReader.java

示例2: testSplitIdsList

点赞 2

import com.sforce.soap.partner.GetUpdatedResult; //导入依赖的package包/类
/**
 * For tSalesforceGetUpdated splitIds
 */
@Test
public void testSplitIdsList() throws Throwable {
    SalesforceGetUpdatedReader updatedReader =
            new SalesforceGetUpdatedReader(null, null, createSalesforceGetDeletedUpdatedProperties(false));
    GetUpdatedResult updatedResult = new GetUpdatedResult();
    // 1. ids size 0
    List<String[]> updatedIdList = updatedReader.splitIds(updatedResult);
    assertEquals(0, updatedIdList.size());
    // 2.ids size 1999
    List<String> updteIds = new ArrayList<>();
    for (int i = 1000; i < 2999; i++) {
        updteIds.add("0019000001fvZV" + i);
    }
    updatedResult.setIds(updteIds.toArray(new String[0]));
    updatedIdList = updatedReader.splitIds(updatedResult);
    assertEquals(1, updatedIdList.size());
    assertEquals(1999, updatedIdList.get(0).length);
    // 3.ids size 2000
    updteIds.add("0019000001fvZV2999");
    updatedResult.setIds(updteIds.toArray(new String[0]));
    updatedIdList = updatedReader.splitIds(updatedResult);
    assertEquals(1, updatedIdList.size());
    assertEquals(2000, updatedIdList.get(0).length);

    // 4.ids size 2001
    updteIds.add("0019000001fvZV3000");
    updatedResult.setIds(updteIds.toArray(new String[0]));
    updatedIdList = updatedReader.splitIds(updatedResult);
    assertEquals(2, updatedIdList.size());
    assertEquals(2000, updatedIdList.get(0).length);
    assertEquals(1, updatedIdList.get(1).length);

    assertEquals("Id, Name, ShippingStreet, ShippingPostalCode, BillingStreet, BillingState, BillingPostalCode",
            updatedReader.getFieldNamesStr());

}
 

开发者ID:Talend,
项目名称:components,
代码行数:40,
代码来源:SalesforceGetDeletedUpdatedReaderTestIT.java

示例3: getRecordIds

点赞 2

import com.sforce.soap.partner.GetUpdatedResult; //导入依赖的package包/类
@Override
protected String[] getRecordIds(GetUpdatedResult result) {
    if (result != null) {
        return result.getIds();
    }
    return new String[0];
}
 

开发者ID:Talend,
项目名称:components,
代码行数:8,
代码来源:SalesforceGetUpdatedReader.java

示例4: getResult

点赞 2

import com.sforce.soap.partner.GetUpdatedResult; //导入依赖的package包/类
@Override
protected GetUpdatedResult getResult() throws IOException, ConnectionException {
    return getConnection().getUpdated(module, startDate, endDate);
}
 

开发者ID:Talend,
项目名称:components,
代码行数:5,
代码来源:SalesforceGetUpdatedReader.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)