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

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


      document.field("name", "something");
      document.field("surname", "something-else");
      document = dbTx.save(document);
      dbTx.commit();
      ODocument doc = dbTx.load(document.getIdentity());
      assertEquals(doc.fields(), document.fields());
      assertEquals(doc.field("name"), document.field("name"));
      assertEquals(doc.field("surname"), document.field("surname"));
    } finally {
      if (dbTx != null)
        dbTx.close();
View Full Code Here


      document.field("name", "something");
      document.field("surname", "something-else");
      document = dbTx.save(document);
      dbTx.commit();
      ODocument doc = dbTx.load(document.getIdentity());
      assertEquals(doc.fields(), document.fields());
      assertEquals(doc.field("name"), document.field("name"));
      assertEquals(doc.field("surname"), document.field("surname"));
    } finally {
      if (dbTx != null)
        dbTx.close();
View Full Code Here

      index++;

      final ORecord rec = record.getRecord();
      if (rec instanceof ODocument) {
        ODocument doc = (ODocument) rec;
        if (!doc.getIdentity().isPersistent() && doc.fields() == 1) {
          // EXTRACT THE FIELD CONTEXT
          Object fieldvalue = doc.field(doc.fieldNames()[0]);
          if (fieldvalue instanceof Collection<?>) {
            command.getContext().push(
                new OTraverseRecordSetProcess(command, ((Collection<OIdentifiable>) fieldvalue).iterator(), getPath()));
View Full Code Here

      return result;

    // Fix of nasty IBM JDK bug. In case of very depth recursive graph serialization
    // ODocument#_source property may be initialized incorrectly.
    final ODocument recordSchemaAware = (ODocument) iRecord;
    if (recordSchemaAware.fields() > 0)
      return null;

    return result;
  }
View Full Code Here

                // TEMPORARY / EMBEDDED
                final ORecord rec = ((OIdentifiable) o).getRecord();
                if (rec != null && rec instanceof ODocument) {
                  // CHECK FOR ONE FIELD ONLY
                  final ODocument doc = (ODocument) rec;
                  if (doc.fields() == 1) {
                    singleFieldName = doc.fieldNames()[0];
                    tempColl.add(doc.field(singleFieldName));
                  } else {
                    // TRANSFORM IT IN EMBEDDED
                    doc.getIdentity().reset();
View Full Code Here

                        fileContents.put("status", "published");
                    }
                }
            }
            ODocument doc = new ODocument(documentType);
            doc.fields(fileContents);
            boolean cached = fileContents.get("cached") != null ? Boolean.valueOf((String)fileContents.get("cached")):true;
            doc.field("cached", cached);
            doc.save();
        } else {
            LOGGER.warn("{} has an invalid header, it has been ignored!", sourceFile);
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.