Examples of QueryResult


Examples of com.sforce.soap.partner.QueryResult

        // make sure there're some records to get
        upsertSfdcAccounts(10);

        // get the client and make the query call
        PartnerClient client = new PartnerClient(getController());
        QueryResult result = client.query("select id from account where " + ACCOUNT_WHERE_CLAUSE);
        SObject[] records = result.getRecords();
        assertNotNull(records);
        assertTrue(records.length > 0);

        return records[0].getId();
    }
View Full Code Here

Examples of com.sforce.soap.partner.QueryResult

                    + extIdField
                    + "!= "
                    + (prevValue.getClass().equals(String.class) ? ("'" + prevValue + "'") : String
                            .valueOf(prevValue));
        }
        QueryResult result = client.query(soql);
        SObject[] records = result.getRecords();
        assertNotNull("Operation should return non-null values", records);
        assertTrue("Operation should return 1 or more records", records.length > 0);
        assertNotNull("Records should have non-null field: " + extIdField + " values", records[0]
                .getField(extIdField));
View Full Code Here

Examples of com.sforce.soap.partner.QueryResult

    @Test
    public void testDateEndingInZ() throws Exception {
        runProcess(getTestConfig(OperationInfo.insert, false), 1);

        QueryResult qr = getBinding().query("select CustomDateTime__c from Account where AccountNumber__c='ACCT_0'");
        assertEquals(1, qr.getSize());

        Date expectedDate = parseDateWithTimezone("2010-10-14T12:00:00.000GMT");
        assertEquals(expectedDate, parseDateFromPartnerApi((String)qr.getRecords()[0].getField("CustomDateTime__c")));
    }
View Full Code Here

Examples of com.sforce.soap.partner.QueryResult

    }

    @Test
    public void testDateUsingDefaultTimeZone() throws Exception {
        runProcess(getTestConfig(OperationInfo.insert, false), 1);
        QueryResult qr = getBinding().query("select CustomDateTime__c from Account where AccountNumber__c='ACCT_0'");
        assertEquals(1, qr.getSize());

        Date expectedDate = parseDateWithTimezone("2010-10-14T12:00:00.000PDT");
        assertEquals(expectedDate, parseDateFromPartnerApi((String)qr.getRecords()[0].getField("CustomDateTime__c")));
    }
View Full Code Here

Examples of com.sforce.soap.partner.QueryResult

    }

    @Test
    public void testDateWithTimeZone() throws Exception {
        runProcess(getTestConfig(OperationInfo.insert, false), 1);
        QueryResult qr = getBinding().query("select CustomDateTime__c from Account where AccountNumber__c='ACCT_0'");
        assertEquals(1, qr.getSize());

        Date expectedDate = parseDateWithTimezone("2010-10-14T12:00:00.000-0300");
        assertEquals(expectedDate, parseDateFromPartnerApi((String)qr.getRecords()[0].getField("CustomDateTime__c")));
    }
View Full Code Here

Examples of com.sforce.soap.partner.wsc.QueryResult

        return query(queryString, true);
    }

    public QueryResult query(String queryString, boolean withClientId) throws ForceConnectionException,
            InsufficientPermissionsException {
        QueryResult result = null;

        if (!withClientId) {
            setNonCallOptions();
        }

        try {
            if (logger.isDebugEnabled()) {
                logger.debug("Execution query statement:\n '" + queryString + "'");
                logConnection();
            }
            result = getPartnerConnection().query(queryString);

            if (result != null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Returned [" + result.getSize() + "] records");
                }
            }

        } catch (ConnectionException e) {
            ForceExceptionUtils.handleConnectionException(this, e);
View Full Code Here

Examples of com.sforce.soap.tooling.QueryResult

    private void attemptToDeleteDuplicate() {
        try {
            String projectIdentifier = forceProject.getProjectIdentifier();
            String soql = String.format("SELECT Id FROM MetadataContainer WHERE name = '%s'", projectIdentifier);
            QueryResult queryResult = stub.query(soql);
            MetadataContainer duplicateContainer = (MetadataContainer) queryResult.getRecords()[0];
            stub.delete(new String[] { duplicateContainer.getId() });
        } catch (ForceRemoteException e) {
            // Let's not try to do nested recovery from a failure handler. Log it.
            logger.debug(e);
        }
View Full Code Here

Examples of com.wordpress.salaboy.context.tracking.json.QueryResult

        method.setRequestEntity(new StringRequestEntity(content, "application/json", "UTF-8"));
        client.executeMethod(method);
       
        Gson gson = new Gson();

    QueryResult result = gson.fromJson(method.getResponseBodyAsString(),
        new TypeToken<QueryResult>() {
        }.getType());

    System.out.println("results: " + result);
    Assert.assertEquals(2, result.getData().size());
    for (List<ResponseNode> data : result.getData()) {
      Map<String, String> props = data.get(0).getData();
      for (String key : props.keySet()) {
        System.out.println("Property ("+key+"): "+props.get(key));
      }
    }

        client = new HttpClient();
        method = new PostMethod("http://localhost:7575/db/data/ext/CypherPlugin/graphdb/execute_query");
        method.setRequestHeader("Content-type", "application/json");
        method.setRequestHeader("Accept", "application/json");
        content = "{\"query\": \"start v=(vehicles, 'vehicleId:" + vehicle.getId() + "')  match (v) <-[USE]- (w)    return w\"}";
        method.setRequestEntity(new StringRequestEntity(content, "application/json", "UTF-8"));
        client.executeMethod(method);
       
        gson = new Gson();

    result = gson.fromJson(method.getResponseBodyAsString(),
        new TypeToken<QueryResult>() {
        }.getType());
               
    System.out.println("results: " + result);
    Assert.assertEquals(1, result.getData().size());
    for (List<ResponseNode> data : result.getData()) {
      Map<String, String> props = data.get(0).getData();
      for (String key : props.keySet()) {
        System.out.println("Property ("+key+"): "+props.get(key));
      }
    }
View Full Code Here

Examples of com.youtube.vitess.vtgate.QueryResult

      if (err.length > 0) {
        error = new String(err);
      }
    }

    QueryResult queryResult = null;
    BSONObject result = (BSONObject) reply.get("Result");
    if (result != null) {
      queryResult = bsonToQueryResult(result, null);
    }
View Full Code Here

Examples of gov.nasa.arc.mct.dbpersistence.search.QueryResult

            q.setMaxResults(maxResults);
            q.setParameter("pattern", pattern);
            q.setParameter("owner", username);
            q.setParameter("creator", (props != null && props.get("creator") != null) ? props.get("creator") : "%" );   
            List<ComponentSpec> daoObjects = q.getResultList();
            return new QueryResult(count, daoObjects);
        } catch (Exception t) {
            LOGGER.error("error executing query", t);
            return null;
        } finally {
          em.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.