Package com.ipc.oce.query

Examples of com.ipc.oce.query.OCQueryResultSelection


    // set parameters
    query.setParameter("NUM_A", new OCVariant(number));
    query.setParameter("DATE_A", new OCVariant(docDate));
   
    OCQueryResult result = query.execute();
    OCQueryResultSelection selection = result.choose();
    OCDocumentRef ref = null;
    if (selection.next()) {
      ref = new OCDocumentRef(selection.getObject(0));
    } else {
      ref = emptyRef();
    }
    return ref;
  }
View Full Code Here


    OCQuery query = instance.newQuery("SELECT Doc.Ref FROM Document." + managerName + " AS Doc WHERE Doc.Number = &NUM_A");
   
    query.setParameter("NUM_A", new OCVariant(number));
   
    OCQueryResult result = query.execute();
    OCQueryResultSelection selection = result.choose();
    int selectionSZ = selection.size();
    List<OCDocumentRef> refList = new ArrayList<OCDocumentRef>(selectionSZ);
    while (selection.next()) {
      refList.add(new OCDocumentRef(selection.getObject(0)));
    }
   
    return refList.toArray(new OCDocumentRef[selectionSZ]);
  }
View Full Code Here

  }
 
  @Test
  public void getResultAndUnload() throws JIException {
    QueryTemplate qt = new QueryTemplate(app);
    OCQueryResultSelection selection = qt.queryForSelection("SELECT * FROM Catalog.Валюты");
    OCQueryResult result = selection.getOwner();
    OCValueTable vt = result.unload();
    assertTrue(vt.size() > 0);
    OCValueTableColumnCollection vtCC = vt.getColumns();
    int vtCCSZ = vtCC.size();
    assertTrue(vtCCSZ > 0);
View Full Code Here

     
      if (LOG.isInfoEnabled()) {
        LOG.info("Query: " + query);
      }
     
      OCQueryResultSelection selection = template.queryForSelection(query);
      MarshalHelper marshalHelper = new MarshalHelper(app);
      String xml = marshalHelper.selection2xml(selection, Integer.valueOf(mode));
      return Response.ok(xml).build();
    } catch (Exception e) {
      throw new WebApplicationException(e);
View Full Code Here

TOP

Related Classes of com.ipc.oce.query.OCQueryResultSelection

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.