Package com.salesforce.dataloader.model

Examples of com.salesforce.dataloader.model.Row


    @Test
    public void testMapDataEmptyEntriesIgnored() throws Exception {
        LoadMapper loadMapper = new LoadMapper(null, null, null);
        loadMapper.putMapping("SOURCE_COL", "");

        Row inputData = Row.singleEntryImmutableRow("SOURCE_COL", "123");

        Map<String, Object> result = loadMapper.mapData(inputData);

        assertTrue("Empty destination column should have not been mapped", result.isEmpty());
    }
View Full Code Here


    /**
     * Helper method to verify that the LoadMapper has mapped the specified columns to their correct respective field, along with any constants in the mapping file.
     */
    private void verifyMapping(LoadMapper mapper, String... destNames) {
        Row destValueMap = mapper.mapData(this.sourceRow);
        for (int i = 0; i < destNames.length; i++) {
            assertNotNull("Destination# " + i + "(" + destNames[i]
                    + ") should have a mapped value",
                    destValueMap.get(destNames[i]));
            assertEquals("Destination# " + i + "(" + destNames[i]
                    + ") should contain the expected value", SOURCE_VALUES[i],
                    destValueMap.get(destNames[i]));
        }
        // verify constant mapped correctly
        assertEquals("Destination[" + DEST_CONSTANT_NAME
                + "] should contain constant", CONSTANT_VALUE,
                destValueMap.get(DEST_CONSTANT_NAME));
    }
View Full Code Here

            this.qr = getController().getPartnerClient().queryMore(this.qr.getQueryLocator());
        }
    }

    private Row getDaoRow(SObject sob) {
        Row row = getMapper().mapPartnerSObjectSfdcToLocal(sob);
        for (Map.Entry<String, Object> ent : row.entrySet()) {
            Object newVal = convertFieldValue(ent.getValue());
            if (newVal != ent.getValue()) row.put(ent.getKey(), newVal);
        }
        return row;
    }
View Full Code Here

    @Override
    public final void visit(Row row) throws OperationException, DataAccessObjectException,
    ConnectionException {
        initLoadRateCalculator();
        // the result are sforce fields mapped to data
        Row sforceDataRow = getMapper().mapData(row);
        try {
            convertBulkAPINulls(sforceDataRow);
            dynaArray.add(SforceDynaBean.convertToDynaBean(dynaClass, sforceDataRow));
        } catch (ConversionException conve) {
            String errMsg = Messages.getMessage("Visitor", "conversionErrorMsg", conve.getMessage());
View Full Code Here

                    List<String> headers;
                    headers = rdr.nextRecord();
                    List<String> csvRow;
                    while ((csvRow = rdr.nextRecord()) != null) {
                        final StringBuilder id = new StringBuilder();
                        final Row daoRow = getDaoRow(headers, csvRow, id);
                        addResultRow(daoRow, id.toString());
                    }
                } finally {
                    resultStream.close();
                }
View Full Code Here

TOP

Related Classes of com.salesforce.dataloader.model.Row

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.