Package com.orientechnologies.orient.core.record.impl

Examples of com.orientechnologies.orient.core.record.impl.ODocument.reload()


    ODocument doc2 = new ODocument("Order");
    doc2.field("context", "test");
    doc2.field("date", System.currentTimeMillis());
    doc2.save();

    doc2.reload();
    Assert.assertTrue(doc2.field("date", OType.DATE) instanceof Date);

    doc2.reload();
    Assert.assertTrue(doc2.field("date", Date.class) instanceof Date);
View Full Code Here


    doc2.save();

    doc2.reload();
    Assert.assertTrue(doc2.field("date", OType.DATE) instanceof Date);

    doc2.reload();
    Assert.assertTrue(doc2.field("date", Date.class) instanceof Date);

    List<ODocument> result = database.command(
        new OSQLSynchQuery<ODocument>("select * from Order where date >= ? and context = 'test'")).execute(begin);

View Full Code Here

    ODocument document = new ODocument();
    document.field("ridBag", ridBag);

    Assert.assertTrue(ridBag.isEmbedded());
    document.save();
    document.reload();

    ridBag = document.field("ridBag");
    Assert.assertTrue(ridBag.isEmbedded());

    List<OIdentifiable> addedItems = new ArrayList<OIdentifiable>();
View Full Code Here

    Iterator<OIdentifiable> iterator = documentCopy.<ORidBag> field("ridBag").iterator();
    iterator.next();
    iterator.remove();

    Assert.assertTrue(!ODocumentHelper.hasSameContentOf(document, database, documentCopy, database, null));
    documentCopy.reload("*:-1", true);

    embeddedList = documentCopy.field("embeddedList");
    ODocument doc = embeddedList.get(0);

    iterator = doc.<ORidBag> field("ridBag").iterator();
View Full Code Here

      OUser ouser=DbHelper.getConnection().getMetadata().getSecurity().getUser(username);
      ouser.getRoles().remove(oldORole);
      ouser.addRole(newORole);
      ouser.save();
      profile.save();
      profile.reload();

      return profile;
    }catch (OSerializationException e){
      throw new InvalidJsonException(e);
    }catch (Exception e){
View Full Code Here

  }

  public void reload() {
    final ODocument rec = getRecord();
    if (rec != null)
      rec.reload(null, true);
  }

  protected void copyTo(final OrientElement iCopy) {
    iCopy.graph = graph;
    iCopy.settings = settings;
View Full Code Here

    OIdentifiable result = database.command(
        new OCommandSQL("create function FunctionsTest \"return a + b\" PARAMETERS [a,b] IDEMPOTENT true LANGUAGE Javascript"))
        .execute();

    final ODocument record = result.getRecord();
    record.reload();

    final List<String> parameters = record.field("parameters");

    Assert.assertNotNull(parameters);
    Assert.assertEquals(parameters.size(), 2);
View Full Code Here

    } else if (fieldRecord.getSchemaClass().isSubClassOf(OrientEdgeType.CLASS_NAME)) {
      // EDGE
      if (settings.useVertexFieldsForEdgeLabels || OrientEdge.isLabeled(OrientEdge.getRecordLabel(fieldRecord), iLabels)) {
        final OIdentifiable vertexDoc = OrientEdge.getConnection(fieldRecord, connection.getKey().opposite());
        if (vertexDoc == null) {
          fieldRecord.reload();
          if (vertexDoc == null) {
            OLogManager.instance().warn(this,
                "Cannot load edge " + fieldRecord + " to get the " + connection.getKey().opposite() + " vertex");
            return;
          }
View Full Code Here

          || OrientEdge.isLabeled(
          OrientEdge.getRecordLabel(fieldRecord), iLabels)) {
        final OIdentifiable vertexDoc = OrientEdge.getConnection(
            fieldRecord, connection.getKey().opposite());
        if (vertexDoc == null) {
          fieldRecord.reload();
          if (vertexDoc == null) {
            OLogManager.instance().warn(
                this,
                "Cannot load edge " + fieldRecord
                    + " to get the "
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.