Examples of OSQLSynchQuery


Examples of com.orientechnologies.orient.core.sql.query.OSQLSynchQuery

      // connecting a deleted vertex during a transaction
      ODocument bar = graph.addVertex("class:Bar", "prop", "test1").getRecord();
      ODocument sees = graph.addEdge(null, graph.getVertex(foo), graph.getVertex(bar), "Sees").getRecord();
      graph.commit();

      List<ODocument> foos = graph.getRawGraph().query(new OSQLSynchQuery("select * from Foo"));
      Assert.assertEquals(foos.size(), 1);

      graph.removeVertex(graph.getVertex(foos.get(0)));
    } finally {
      graph.shutdown();
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.query.OSQLSynchQuery

    final OClass clazz = schema.createClass("test");
    clazz.createProperty("numericAtt", OType.DOUBLE);

    db.command(new OCommandSQL("INSERT INTO test(numericAtt) VALUES (28.23)")).execute();

    final List<ODocument> docs = db.query(new OSQLSynchQuery("SELECT FROM test"));
    Double value = (Double) docs.get(0).field("numericAtt");

    System.out.println(value);

    Assert.assertEquals(new Double(28.23), new Float(28.23).doubleValue());
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.query.OSQLSynchQuery

  public void testIndexReturnOnlySpecifiedClass() throws Exception {
    List<ODocument> result;

    ODatabaseDocument db = database.getUnderlying();

    result = db.command(new OSQLSynchQuery("select * from ChildTestClass where testParentProperty = 10")).execute();
    Assert.assertNotNull(result);
    Assert.assertEquals(1, result.size());
    Assert.assertEquals(10L, result.get(0).field("testParentProperty"));

    result = db.command(new OCommandSQL("select * from AnotherChildTestClass where testParentProperty = 11")).execute();
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.