Package org.teiid.language

Examples of org.teiid.language.Argument


        }
             
        buffer.append(Tokens.LPAREN);
        final List<Argument> params = obj.getArguments();
        if (params != null && params.size() != 0) {
            Argument param = null;
            for (int i = 0; i < params.size(); i++) {
                param = params.get(i);
                if (param.getDirection() == Direction.IN || param.getDirection() == Direction.INOUT) {
                    if (i != 0) {
                        buffer.append(Tokens.COMMA)
                              .append(Tokens.SPACE);
                    }
                    append(param);
View Full Code Here


  public void execute(ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
    try {
      Call command = parent.getCommand();
      List<Argument> params = command.getArguments();
     
      Argument object = params.get(OBJECT);
      String objectName = (String) object.getArgumentValue().getValue();
     
      Argument start = params.get(STARTDATE);
      Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
      GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
      tempCalendar.setTime(startTime);
      XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
     
      Argument end = params.get(ENDDATE);
      Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
      tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
      tempCalendar.setTime(endTime);
      XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
     
      updatedResult = parent.getConnection().getUpdated(objectName, startCalendar, endCalendar);
View Full Code Here

            registerSpecificTypeOfOutParameter(statement, returnType, index++);
        }
       
        Iterator iter = params.iterator();
        while(iter.hasNext()){
            Argument param = (Argument)iter.next();
                   
            if(param.getDirection() == Direction.INOUT){
                registerSpecificTypeOfOutParameter(statement,param.getType(), index);
            }else if(param.getDirection() == Direction.OUT){
                registerSpecificTypeOfOutParameter(statement,param.getType(), index++);
            }
                   
            if(param.getDirection() == Direction.IN || param.getDirection() == Direction.INOUT){
                bindValue(statement, param.getArgumentValue().getValue(), param.getType(), index++);
            }
        }
        boolean resultSetNext = statement.execute();
       
        while (!resultSetNext) {
View Full Code Here

            //we can assume for now that all arguments will be literals, which may be multivalued
            Literal value = null;
            if (direction != Direction.OUT) {
              value = (Literal)translate(param.getExpression());
            }
            Argument arg = new Argument(direction, value, param.getClassType(), metadataParam);
            translatedParameters.add(arg);
        }
                       
        Call call = new Call(removeSchemaName(sp.getProcedureName()), translatedParameters, proc);
        call.setReturnType(returnType);
View Full Code Here

  public void execute(ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
    try {
      Call command = parent.getCommand();
      List<Argument> params = command.getArguments();
     
      Argument object = params.get(OBJECT);
      String objectName = (String) object.getArgumentValue().getValue();
     
      Argument start = params.get(STARTDATE);
      Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
      GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
      tempCalendar.setTime(startTime);
      XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
     
      Argument end = params.get(ENDDATE);
      Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
      tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
      tempCalendar.setTime(endTime);
      XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
     
      deletedResult = parent.getConnection().getDeleted(objectName, startCalendar, endCalendar);
View Full Code Here

  @Test public void testGetTextFiles() throws Exception {
    FileExecutionFactory fef = new FileExecutionFactory();
    FileConnection fc = Mockito.mock(FileConnection.class);
    Mockito.stub(fc.getFile("*.txt")).toReturn(new File(UnitTestUtil.getTestDataPath(), "*.txt"));
    Call call = fef.getLanguageFactory().createCall("getTextFiles", Arrays.asList(new Argument(Direction.IN, new Literal("*.txt", TypeFacility.RUNTIME_TYPES.STRING), TypeFacility.RUNTIME_TYPES.STRING, null)), null);
    ProcedureExecution pe = fef.createProcedureExecution(call, null, null, fc);
    pe.execute();
    int count = 0;
    while (true) {
      if (pe.next() == null) {
View Full Code Here

TOP

Related Classes of org.teiid.language.Argument

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.