Examples of QueryCommand


Examples of com.impossibl.postgres.protocol.QueryCommand

      resultBatch = preparedQuery(null, pq.name, Object[].class, Collections.<Type>emptyList(), Collections.emptyList(), pq.resultFields);
    }
    else {

      QueryCommand query = protocol.createQuery(queryTxt);

      protocol.execute(query);

      if (query.getError() != null) {
        throw new NoticeException("Error querying", query.getError());
      }

      List<QueryCommand.ResultBatch> resultBatches = query.getResultBatches();

      if (resultBatches.isEmpty()) {
        resultBatch = null;
      }
      else {
        resultBatch = query.getResultBatches().get(0);
      }

    }

    if (resultBatch == null) {
View Full Code Here

Examples of org.apache.solr.search.grouping.distributed.command.QueryCommand

      if (TopGroupsFieldCommand.class.isInstance(command)) {
        TopGroupsFieldCommand fieldCommand = (TopGroupsFieldCommand) command;
        SchemaField groupField = rb.req.getSearcher().getSchema().getField(fieldCommand.getKey());
        commandResult = serializeTopGroups(fieldCommand.result(), groupField);
      } else if (QueryCommand.class.isInstance(command)) {
        QueryCommand queryCommand = (QueryCommand) command;
        commandResult = serializeTopDocs(queryCommand.result());
      } else {
        commandResult = null;
      }

      result.add(command.getKey(), commandResult);
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

        cmd.getCommands().add( new InsertObjectCommand( new Person( "hadrian" ) ) );
        cmd.getCommands().add( new InsertObjectCommand( new Person( "baunax",
                                                                    43 ) ) );
        cmd.getCommands().add( new InsertObjectCommand( new Person( "baunax",
                                                                    21 ) ) );
        cmd.getCommands().add( new QueryCommand( "persons",
                                                 "persons",
                                                 null ) );
        cmd.getCommands().add( new QueryCommand( "person",
                                                 "personWithName",
                                                 new String[]{"baunax"} ) );

        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            QueryCommand cmd = (QueryCommand) object;

            writer.startNode( "out-identifier" );
            writer.setValue( cmd.getOutIdentifier() );
            writer.endNode();

            writer.startNode( "name" );
            writer.setValue( cmd.getName() );
            writer.endNode();

            if ( cmd.getArguments() != null && cmd.getArguments().size() > 0 ) {
                writer.startNode( "args" );
                for ( Object arg : cmd.getArguments() ) {
                    writeItem( arg,
                               context,
                               writer );
                }
                writer.endNode();
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

                    }
                }
                reader.moveUp();
            }

            QueryCommand cmd = new QueryCommand( outIdentifier,
                                                 name,
                                                 (args != null) ? args.toArray( new Object[args.size()] ) : null );

            return cmd;
        }
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

        return (T) this.commandService.execute( command );
    }

    public QueryResults getQueryResults(String query,
                                        Object... arguments) {
        QueryCommand cmd = new QueryCommand( (String)null,
                                             query,
                                             arguments );
        return this.commandService.execute( cmd );
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

    public SetterImpl createModifyCommand$SetterImpl() {
        return new SetterImpl();
    }
   
    public QueryCommand createQueryCommand() {
        return new QueryCommand();
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

        kContext.set("ksession", ksession);

        commandService = new DefaultCommandService(kContext);
        List cmds = new ArrayList();
       
        QueryCommand queryCommand = new QueryCommand("out", "myQuery", new Object[]{});
        SetVariableCommandFromCommand setVariableCmd = new SetVariableCommandFromCommand("__TEMP__", "query123", queryCommand);
        cmds.add(setVariableCmd);
       
        BatchExecutionCommand batchCmd = CommandFactory.newBatchExecution(cmds, "kresults");
        ExecuteCommand execCmd = new ExecuteCommand(batchCmd,true);
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

        kContext.set("localResults", localKresults);
        kContext.set("ksession", ksession);

        commandService = new DefaultCommandService(kContext);
       
        QueryCommand queryCommand = new QueryCommand("out", "myQuery", new Object[]{});
        SetVariableCommandFromCommand setVariableCmd = new SetVariableCommandFromCommand("__TEMP__", "query123", queryCommand);
       
        KnowledgeContextResolveFromContextCommand resolveFromContextCommand = new KnowledgeContextResolveFromContextCommand(setVariableCmd,
                null, null, "ksession", "localResults");
        ExecutionResults results = (ExecutionResults) commandService.execute(resolveFromContextCommand);
View Full Code Here

Examples of org.drools.command.runtime.rule.QueryCommand

                                                     String workItemName) {
        return new RegisterWorkItemHandlerCommand( workItemName, handler );
    }   
   
    public Command newQuery(String identifier, String name) {
        return new QueryCommand(identifier, name, null);
    }
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.