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

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


    // REMOVE FIELD IF ANY
    for (Map.Entry<String, Object> entry : removeEntries.entrySet()) {
      v = entry.getValue();
      if (v == EMPTY_VALUE) {
        record.removeField(entry.getKey());
        recordUpdated = true;
      } else {
        fieldValue = record.field(entry.getKey());

        if (fieldValue instanceof Collection<?>) {
View Full Code Here


    // REMOVE FIELD IF ANY
    for (Map.Entry<String, Object> entry : removeEntries.entrySet()) {
      v = entry.getValue();
      if (v == EMPTY_VALUE) {
        record.removeField(entry.getKey());
        recordUpdated = true;
      } else {
        fieldValue = record.field(entry.getKey());

        if (fieldValue instanceof Collection<?>) {
View Full Code Here

    // REMOVE FIELD IF ANY
    for (Map.Entry<String, Object> entry : removeEntries.entrySet()) {
      v = entry.getValue();
      if (v == EMPTY_VALUE) {
        record.removeField(entry.getKey());
        recordUpdated = true;
      } else {
        fieldValue = record.field(entry.getKey());

        if (fieldValue instanceof Collection<?>) {
View Full Code Here

    // REMOVE FIELD IF ANY
    for (Map.Entry<String, Object> entry : removeEntries.entrySet()) {
      v = entry.getValue();
      if (v == EMPTY_VALUE) {
        record.removeField(entry.getKey());
        recordUpdated = true;
      } else {
        fieldValue = record.field(entry.getKey());

        if (fieldValue instanceof Collection<?>) {
View Full Code Here

       for (Entry<String, String> f : fields.entrySet()) {
         final Object oldValue = doc.rawField(f.getKey());
         String userValue = f.getValue();

         if (userValue != null && userValue.equals("undefined"))
           doc.removeField(f.getKey());
         else {
           Object newValue = ORecordSerializerStringAbstract.getTypeValue(userValue);

           if (newValue != null) {
             if (newValue instanceof Collection) {
View Full Code Here

    if (ODocumentSerializable.class.isAssignableFrom(clazz)) {
      try {
        final ODocumentSerializable documentSerializable = (ODocumentSerializable) clazz.newInstance();
        final ODocument docClone = new ODocument();
        instance.copyTo(docClone);
        docClone.removeField(ODocumentSerializable.CLASS_NAME);
        documentSerializable.fromDocument(docClone);

        return documentSerializable;
      } catch (InstantiationException e) {
        throw new OSerializationException("Cannot serialize the object", e);
View Full Code Here

    Assert.assertFalse(document.isDirty());

    final List<String> trackedList = document.field("embeddedlist");
    trackedList.add("value2");

    document.removeField("embeddedlist");

    Assert.assertEquals(document.getDirtyFields(), new String[] { "embeddedlist" });
    Assert.assertTrue(document.isDirty());
    Assert.assertNull(document.getCollectionTimeLine("embeddedlist"));
  }
View Full Code Here

  private Object copy(final ODocument document, final Object[] iFieldNames) {
    final ODocument doc = document.copy();
    for (Object iFieldName : iFieldNames) {
      if (iFieldName != null) {
        final String fieldName = iFieldName.toString();
        doc.removeField(fieldName);
      }
    }
    return doc;
  }
View Full Code Here

  private Object copy(final Map map, final Object[] iFieldNames) {
    final ODocument doc = new ODocument().fields(map);
    for (Object iFieldName : iFieldNames) {
      if (iFieldName != null) {
        final String fieldName = iFieldName.toString();
        doc.removeField(fieldName);
      }
    }
    return doc;
  }
}
View Full Code Here

    Assert.assertEquals(propOneIndex.getSize(), 1);
    Assert.assertEquals(compositeIndex.getSize(), 1);
    Assert.assertEquals(propZeroIndex.getSize(), 1);

    doc.removeField("prop2");
    doc.removeField("prop0");
    doc.save();

    Assert.assertEquals(propOneIndex.getSize(), 1);
    Assert.assertEquals(compositeIndex.getSize(), 0);
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.