Package org.openengsb.core.api.model

Examples of org.openengsb.core.api.model.QueryRequest


    public void testIfQueryForDeletedObjects_onlyReturnsDeletedObjects() {
        EDBObject v1 = createRandomTestObject("/test/query/16/1");
        commitObjects(Lists.newArrayList(v1), null, null);
        commitObjects(null, null, Lists.newArrayList(v1));

        QueryRequest request = QueryRequest.create();
        List<EDBObject> result = db.query(request);
        assertThat(result.size(), is(0));

        result = db.query(request.deleted());
        assertThat(result.size(), is(1));
    }
View Full Code Here


    public void deleteCommit(UUID revision) throws EDBException {
        if (revision == null) {
            throw new EDBException("null revision not allowed");
        }
        JPACommit commit = dao.getJPACommit(revision.toString());
        QueryRequest request =
            QueryRequest.create().deleted().orJoined();
        for (String oid : commit.getDeletions()) {
            request.addParameter("oid", oid);
        }
        List<JPAObject> deletedObjects = dao.query(request);
        performDeleteLogic(commit, deletedObjects);
    }
View Full Code Here

            LOGGER.debug("Got invalid timestamp string. Use the current timestamp instead");
            time = System.currentTimeMillis();
        } else {
            time = Long.parseLong(timestamp);
        }
        QueryRequest request = parseQueryString(query);
        request.setTimestamp(time);
        return query(model, request);
    }
View Full Code Here

    /**
     * Parses the previously split query string into a query request and fills the parameters of the object
     * with the data.
     */
    private QueryRequest createQueryRequest(String[] elements) {
        QueryRequest request = QueryRequest.create();
        for (String element : elements) {
            String[] parts = StringUtils.split(element, ":", 2);
            parts[0] = parts[0].replace("\\", "\\\\");
            parts[1] = parts[1].replace("\\", "\\\\");
            request.addParameter(parts[0], parts[1].substring(1, parts[1].length() - 1));
        }
        return request;
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.model.QueryRequest

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.