Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.ORecordNotFoundException


      final ORecordInternal<?> currentRecord;
      if (newRecord instanceof ODocument) {
        currentRecord = connection.database.load(rid);

        if (currentRecord == null)
          throw new ORecordNotFoundException(rid.toString());

        final ODocument doc = (ODocument) currentRecord;
        doc.merge((ODocument) newRecord, false, false);

      } else
View Full Code Here


      try {

        final long lastPos = iClusterSegment.getLastEntryPosition();

        if (iRid.clusterPosition > lastPos)
          throw new ORecordNotFoundException("Record " + iRid + " is out cluster size. Valid range for cluster '"
              + iClusterSegment.getName() + "' is 0-" + lastPos);

        final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());
        if (ppos == null || !checkForRecordValidity(ppos))
          // DELETED
View Full Code Here

      lockManager.acquireLock(Thread.currentThread(), iRid, LOCK.SHARED);

      final long lastPos = iClusterSegment.getLastEntryPosition();

      if (iRid.clusterPosition > lastPos)
        throw new ORecordNotFoundException("Record " + iRid + " is out cluster size. Valid range for cluster '"
            + iClusterSegment.getName() + "' is 0-" + lastPos);

      try {
        final OPhysicalPosition ppos = iClusterSegment.getPhysicalPosition(iRid.clusterPosition, new OPhysicalPosition());
View Full Code Here

    Object result = null;
    try {
      result = _database.load(this, iFetchPlan, iIgnoreCache);
    } catch (Exception e) {
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found", e);
    }

    if (result == null)
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found");

    return (ODocument) result;
  }
View Full Code Here

  public ORecordInternal<T> load() {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record");

    if (!getIdentity().isValid())
      throw new ORecordNotFoundException("The record has no id, probably it's new or transient yet ");

    try {
      final ORecordInternal<?> result = _database.load(this);

      if (result == null)
        throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found");

      return (ORecordInternal<T>) result;
    } catch (Exception e) {
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found", e);
    }
  }
View Full Code Here

  public ORecordInternal<T> reload(final String iFetchPlan, final boolean iIgnoreCache) {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record");

    if (!getIdentity().isValid())
      throw new ORecordNotFoundException("The record has no id, probably it's new or transient yet ");

    try {
      _database.reload(this, iFetchPlan, iIgnoreCache);

      // GET CONTENT
      // fromStream(toStream());

      return this;
    } catch (Exception e) {
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found", e);
    }
  }
View Full Code Here

  }

  public void delete(final ORecordId iRid, final int iVersion) {
    try {
      if (!storage.deleteRecord(iRid, iVersion))
        throw new ORecordNotFoundException("The record with id " + iRid + " was not found");

    } catch (OException e) {
      // PASS THROUGH
      throw e;
    } catch (Exception e) {
View Full Code Here

  }

  public void delete(final ORecordId iRid, final int iVersion) {
    try {
      if (!storage.deleteRecord(iRid, iVersion))
        throw new ORecordNotFoundException("The record with id #" + iRid + " was not found");

    } catch (Exception e) {
      OLogManager.instance().exception("Error on deleting record #" + iRid, e, ODatabaseException.class);
    }
  }
View Full Code Here

    Object result = null;
    try {
      result = _database.load(this, iFetchPlan);
    } catch (Exception e) {
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found", e);
    }

    if (result == null)
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' was not found");

    return (ODocument) result;
  }
View Full Code Here

    try {
      db = getProfiledDatabaseInstance(iRequest);

      final ORecord<?> record = db.getDictionary().get(urlParts[2]);
      if (record == null)
        throw new ORecordNotFoundException("Key '" + urlParts[2] + "' was not found in the database dictionary");

      sendRecordContent(iRequest, record);

    } finally {
      if (db != null)
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.ORecordNotFoundException

Copyright © 2018 www.massapicom. 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.