Examples of query()


Examples of com.orientechnologies.orient.core.db.document.ODatabaseDocument.query()

    testLinkClassDocument.field("testBoolean", true);
    testClassDocument.field("testLink", testLinkClassDocument);
    testClassDocument.save();
    // THIS WILL THROW A java.lang.ClassCastException: com.orientechnologies.orient.core.id.ORecordId cannot be cast to
    // java.lang.Boolean
    List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select from TestClass where testLink.testBoolean = true"));
    Assert.assertEquals(result.size(), 1);
    // THIS WILL THROW A java.lang.ClassCastException: com.orientechnologies.orient.core.id.ORecordId cannot be cast to
    // java.lang.String
    result = db.query(new OSQLSynchQuery<ODocument>("select from TestClass where testLink.testString = 'Test Link Class 1'"));
    Assert.assertEquals(result.size(), 1);
View Full Code Here

Examples of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.query()

  public void deleteInPool() {
    ODatabaseDocumentTx db = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");

    final Long total = db.countClass("Profile");

    final List<ODocument> resultset = db.query(new OSQLSynchQuery<Object>(
        "select from Profile where sex = 'male' and salary > 120 and salary <= 133"));

    final Number records = (Number) db.command(
        new OCommandSQL("delete from Profile where sex = 'male' and salary > 120 and salary <= 133")).execute();
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphDatabase.query()

    // ODocument vertex1 = (ODocument) db.createVertex().field("label", "car").save();
    // ODocument vertex2 = (ODocument) db.createVertex().field("label", "pilot").save();
    // ODocument edge = (ODocument) db.createEdge(vertex1, vertex2).field("label", "drives").save();

    List<?> result = db.query(new OSQLSynchQuery<Object>(
        "select gremlin('current.out.in') as value from V where out.size() > 0 limit 3"));
    System.out.println("Result: " + result);

    result = db.query(new OSQLSynchQuery<Object>("select gremlin('current.out.in') as value from 5:1"));
    System.out.println("Result: " + result);
View Full Code Here

Examples of com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.query()

  @Test
  public void queryProjectionObjectLevel() {
    ODatabaseObjectTx db = new ODatabaseObjectTx(url);
    db.open("admin", "admin");

    List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>(" select nick, followings, followers from Profile "));

    Assert.assertTrue(result.size() != 0);

    for (ODocument d : result) {
      Assert.assertNull(d.getClassName());
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecord.query()

  //loaded when open database
  public void load() {
    schedulers.clear();
    final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
    if (db.getMetadata().getSchema().existsClass(OScheduler.CLASSNAME)) {
      List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select from " + OScheduler.CLASSNAME + " order by name"));
      for (ODocument d : result) {
        d.reload();
          this.addScheduler(new OScheduler(d));
      }
    }
View Full Code Here

Examples of com.orientechnologies.orient.object.db.OObjectDatabaseTx.query()

            System.out.println(time);
            times.add(time);

            start = System.currentTimeMillis();
            for (int j = 0; j < operations_read; j++) {
              List<DummyObject> l = tx.query(new OSQLSynchQuery<DummyObject>(" select * from DummyObject "));
              Assert.assertEquals(l.size(), operations_write);

              if ((j + 1) % 20000 == 0) {
                System.out.println("(" + getDbId(tx) + ") " + "Operations (READ) executed: " + j + 1);
              }
View Full Code Here

Examples of com.rapleaf.jack.test_project.database_1.iface.IUserPersistence.query()

    }

    List<User> result;

    // Test Max
    result = users.query()
        .select(User._Fields.handle)
        .selectAgg(max(User._Fields.num_posts))
        .groupBy(User._Fields.handle)
        .orderByHandle()
        .findWithOrder();
View Full Code Here

Examples of com.salesforce.ide.core.remote.Connection.query()

            logger.warn("Unable to load s-controls - project is null");
            return null;
        }

        Connection connection = getConnectionFactory().getConnection(project);
        SObject[] sobjects = connection.query(SoqlEnum.getScontrolsByContentSource("HTML")).getRecords();

        if (Utils.isEmpty(sobjects)) {
            logger.warn("Unable to load s-controls - returned s-controls of type 'HTML' is null or empty");
            return null;
        }
View Full Code Here

Examples of com.sap.hadoop.windowing.parser.Windowing2Parser.query()

    {
      lexer = new Windowing2Lexer(new ANTLRStringStream(query));
      tokens = new CommonTokenStream(lexer);
      parser = new Windowing2Parser(tokens);
      parser.setTreeAdaptor(TranslateUtils.adaptor);
      t = (CommonTree) parser.query().getTree();
     
      err = parser.getWindowingParseErrors();
      if ( err != null )
      {
        throw new WindowingException(err);
View Full Code Here

Examples of com.socrata.api.Soda2Consumer.query()

        final Soda2Consumer   soda2Consumer = new Soda2Consumer(connection);

        //
        //   Issue query as a full query
        final ClientResponse responseFullQuery = soda2Consumer.query(dataset, HttpLowLevel.JSON_TYPE, query.toString());
        final List<ToxinData> resultsFullQuery = responseFullQuery.getEntity(new GenericType<List<ToxinData>>() {});
        TestCase.assertEquals(6, resultsFullQuery.size());
        for (ToxinData toxinData : resultsFullQuery) {
            TestCase.assertEquals(325510L, toxinData.getPrimaryNAICS());
        }
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.