Examples of ODocument


Examples of com.orientechnologies.orient.core.record.impl.ODocument

          // MAX DEPTH REACHED: STOP TO FETCH THIS FIELD
          continue;

        Object userObject;
        if (fieldValue instanceof ODocument) {
          final ODocument linked = (ODocument) fieldValue;
          try {
            userObject = iListener.fetchLinked(iRootRecord, iUserObject, fieldName, linked);
            if (userObject != null)
              // GO RECURSIVELY
              fetch(linked, userObject, iFetchPlan, fieldName, iCurrentLevel + 1, iMaxFetch, iListener);
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

  @Test
  public void testSecurityAccessWriter() throws IOException {
    database.open("writer", "writer");

    try {
      new ODocument(database, "Profile").save("internal");
      Assert.assertTrue(false);
    } catch (OSecurityAccessException e) {
      Assert.assertTrue(true);
    } catch (ODatabaseException e) {
      Assert.assertTrue(e.getCause() instanceof OSecurityAccessException);
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

  @Test
  public void testSecurityAccessReader() throws IOException {
    database.open("reader", "reader");

    try {
      new ODocument(database, "Profile").save();
    } catch (OSecurityAccessException e) {
      Assert.assertTrue(true);
    } catch (ODatabaseException e) {
      Assert.assertTrue(e.getCause() instanceof OSecurityAccessException);
    } finally {
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

      } else {
        // LINK OR EMBEDDED
        fieldClass = iEntityManager.getEntityClass(fieldClass.getSimpleName());
        if (fieldClass != null) {
          // RECOGNIZED TYPE, SERIALIZE IT
          final ODocument linkedDocument = (ODocument) iObj2RecHandler.getRecordByUserObject(iFieldValue, true);

          final Object pojo = iFieldValue;
          iFieldValue = toStream(pojo, linkedDocument, iEntityManager, linkedDocument.getSchemaClass(), iObj2RecHandler, db,
              iSaveOnlyDirty);

//          if (linkedDocument.isDirty()) {
//            // SAVE THE DOCUMENT AND GET UDPATE THE VERSION. CALL THE UNDERLYING SAVE() TO AVOID THE SERIALIZATION THREAD IS CLEANED
//            // AND GOES RECURSIVELY UP THE STACK IS EXHAUSTED
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

      final boolean iAutomatic) {
    acquireExclusiveLock();
    try {

      name = iName;
      configuration = new ODocument(iDatabase);
      automatic = iAutomatic;
      keyType = iKeyType;

      if (iClusterIdsToIndex != null)
        for (int id : iClusterIdsToIndex)
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.tailMap(fromKey, isInclusive);
      if (subSet != null) {
        for (Entry<Object, Set<OIdentifiable>> v : subSet.entrySet()) {
          for (OIdentifiable id : v.getValue()) {
            final ODocument document = new ODocument();
            document.field("key", v.getKey());
            document.field("rid", id.getIdentity());
            document.unsetDirty();
            result.add(document);
          }
        }
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.headMap(toKey, isInclusive);
      if (subSet != null) {
        for (Entry<Object, Set<OIdentifiable>> v : subSet.entrySet()) {
          for (OIdentifiable id : v.getValue()) {
            final ODocument document = new ODocument();
            document.field("key", v.getKey());
            document.field("rid", id.getIdentity());
            document.unsetDirty();
            result.add(document);
          }
        }
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

  @Test
  public void testFullTextInsertion() {
    database.open("admin", "admin");

    ODocument doc = new ODocument(database);

    StringBuilder text = new StringBuilder();
    Random random = new Random(1000);

    for (int i = 0; i < TOT; ++i) {
      doc.reset();
      doc.setClassName("Whiz");
      doc.field("id", i);
      doc.field("date", new Date());

      text.setLength(0);
      for (int w = 0; w < 10; ++w) {
        if (w > 0)
          text.append(' ');
        text.append(words[random.nextInt(words.length - 1)]);
      }

      doc.field("text", text.toString());

      doc.save();
    }

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.subMap(iRangeFrom, iInclusive, iRangeTo, iInclusive);
      if (subSet != null) {
        for (Entry<Object, Set<OIdentifiable>> v : subSet.entrySet()) {
          for (OIdentifiable id : v.getValue()) {
            final ODocument document = new ODocument();
            document.field("key", v.getKey());
            document.field("rid", id.getIdentity());
            document.unsetDirty();
            result.add(document);
          }
        }
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument

        iProgressListener.onBegin(this, documentTotal);

      for (String clusterName : clustersToIndex)
        for (ORecord<?> record : getDatabase().browseCluster(clusterName)) {
          if (record instanceof ODocument) {
            final ODocument doc = (ODocument) record;
            final Object fieldValue = callback.getDocumentValueToIndex(doc);

            if (fieldValue != null) {
              put(fieldValue, doc);
              ++documentIndexed;
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.