Examples of Query


Examples of org.kie.api.definition.rule.Query

        for ( Object o : session.getObjects() ) {
            System.out.println( ">>> " + o );
        }
        assertEquals( 1, session.getObjects().size() );

        Query q1 = session.getKieBase().getQuery( "org.drools.tms.test", "foo" );
        Query q2 = session.getKieBase().getQuery( "org.drools.tms.test", "bar" );

        assertNotNull( q1 );
        assertNotNull( q2 );

        QueryResults q10res = session.getQueryResults( "foo", "foo" );
View Full Code Here

Examples of org.lealone.command.dml.Query

    private void initColumnsAndTables(Session session) {
        Column[] cols;
        removeViewFromTables();
        try {
            Query query = compileViewQuery(session, querySQL);
            this.querySQL = query.getPlanSQL();
            tables = New.arrayList(query.getTables());
            ArrayList<Expression> expressions = query.getExpressions();
            ArrayList<Column> list = New.arrayList();
            for (int i = 0, count = query.getColumnCount(); i < count; i++) {
                Expression expr = expressions.get(i);
                String name = null;
                if (columnNames != null && columnNames.length > i) {
                    name = columnNames[i];
                }
View Full Code Here

Examples of org.lilyproject.hbaseindex.Query

     * @param parentRecordId record id of the record to find dependencies for
     * @param vtag     vtag of the record to find dependencies for
     * @return the record ids and vtags on which the given record depends
     */
    Set<DependencyEntry> findDependencies(AbsoluteRecordId parentRecordId, SchemaId vtag) throws IOException {
        final Query query = new Query();
        query.addEqualsCondition("dependant_recordid", parentRecordId.toBytes());
        query.addEqualsCondition("dependant_vtag", vtag.getBytes());

        final Set<DependencyEntry> result;

        final QueryResult queryResult = forwardDerefIndex.performQuery(query);
        if (queryResult.next() != null) {
View Full Code Here

Examples of org.modeshape.jcr.api.query.Query

        waitForIndexes();
        session.save();
        waitForIndexes();

        // Compute a query plan that should use this index ...
        Query query = jcrSql2Query("SELECT * FROM [mix:title] WHERE [jcr:title] = 'The Title'");
        validateQuery().rowCount(1L).useIndex("descriptionIndex").validate(query, query.execute());

        // Compute a query plan that should NOT use this index ...
        query = jcrSql2Query("SELECT * FROM [mix:title] WHERE [jcr:title] LIKE 'The Title'");
        validateQuery().rowCount(1L).useNoIndexes().validate(query, query.execute());

        // Compute a query plan that should use this index ...
        query = jcrSql2Query("SELECT * FROM [mix:title] WHERE [jcr:title] LIKE 'The %'");
        validateQuery().rowCount(1L).useNoIndexes().validate(query, query.execute());

        // Compute a query plan that should use this index ...
        query = jcrSql2Query("SELECT * FROM [mix:title] WHERE [jcr:title] LIKE '% Title'");
        validateQuery().rowCount(2L).useNoIndexes().validate(query, query.execute());

        // Compute a query plan that should use this index ...
        query = jcrSql2Query("SELECT * FROM [mix:title]");
        validateQuery().rowCount(2L).useNoIndexes().validate(query, query.execute());
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.Query

     *
     * @return the resulting query command; never null
     * @see #clear()
     */
    public QueryCommand query() {
        QueryCommand result = new Query(source, constraint, orderings, columns, limit, distinct);
        if (this.firstQuery != null) {
            // EXCEPT has a higher precedence than INTERSECT or UNION, so if the first query is
            // an INTERSECT or UNION SetQuery, the result should be applied to the RHS of the previous set ...
            if (firstQuery instanceof SetQuery && firstQuerySetOperation == Operation.EXCEPT) {
                SetQuery setQuery = (SetQuery)firstQuery;
View Full Code Here

Examples of org.mongojack.DBQuery.Query

          User.class,
          Object.class,
          JSON_MAPPER);
   
    // Ensure that we are only updating the user with the same user-name.
    Query query = DBQuery.is(User.JSON_KEY_USERNAME, user.getUsername());
   
    // Save the user.
    try {
      collection.update(query, user);
    }
View Full Code Here

Examples of org.mule.common.query.Query

    public void queryTranslator() throws Exception {
      FieldComparation name = new FieldComparation(new EqualsOperator(), new Field("name", "java.lang.String"), new org.mule.common.query.expression.StringValue("mariano"));
      FieldComparation age = new FieldComparation(new LessOperator(), new Field("age", "int"), new IntegerValue(30));
      And and = new And(name, age);
     
      Query query = mock(Query.class);
      when(query.getFilterExpression()).thenReturn(and);
     
      String nativeQuery = this.connector.toNativeQuery(query);
      assertEquals(nativeQuery, "eq(name,'mariano'), lt(age,30)");
    }
View Full Code Here

Examples of org.mule.module.db.internal.domain.query.Query

    }

    @Override
    protected Object executeQuery(DbConnection connection, MuleEvent muleEvent) throws SQLException
    {
        Query query = queryResolver.resolve(connection, muleEvent);

        validateQueryType(query.getQueryTemplate());

        List<List<QueryParamValue>> paramValues = resolveParamSets(muleEvent, query);

        BulkExecutor bulkUpdateExecutor = bulkUpdateExecutorFactory.create();
        return bulkUpdateExecutor.execute(connection, query, paramValues);
View Full Code Here

Examples of org.neo4j.cypher.commands.Query

        CypherParser parser = new CypherParser();
        ExecutionEngine engine = new ExecutionEngine(trackingService.getGraphDb());


        //Give me all the vehicle associated with the procedures that are part of the emergency that was created by this phoneCallId
        Query query = parser.parse("start n=(calls, 'callId:" + call.getId() + "')  match (n)-[r:CREATES]->(x)-[i:INSTANTIATE]-> (w) -[u:USE]->v  return v");

        ExecutionResult result = engine.execute(query);
        Iterator<Node> n_column = result.columnAs("v");

View Full Code Here

Examples of org.neo4j.cypherdsl.query.Query

    public void test5_1_1()
    {
        // This test shows how to do partial queries. When the Query from toQuery() is passed into a new CypherQuery
        // it is cloned, so any modifications do not affect the original query

        Query query = start( lookup( "n", "node_auto_index", "name", "User1" ) ).
                match( node( "n" ).out( "hasRoleInGroup" ).node( "hyperEdge" ).out( "hasGroup" ).node( "group" ),
                        node( "hyperEdge" ).out( "hasRole" ).node( "role" ) ).toQuery();

        assertQueryEquals( CYPHER + "START n=node:node_auto_index(name=\"User1\") MATCH (n)-[:hasRoleInGroup]->" +
                "(hyperEdge)-[:hasGroup]->(group),(hyperEdge)-[:hasRole]->(role) WHERE group.name=\"Group2\" RETURN " +
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.