Package com.orientechnologies.orient.core.exception

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


    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


  }

  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 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");

      if (result != this) {
        // GET CONTENT
        // result.toStream();
        // fromStream(result.toStream());
      }

      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 ODocument load(final String iFetchPlan, boolean iIgnoreCache) {
    Object result;
    try {
      result = getDatabase().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 ODocument load(final String iFetchPlan, boolean iIgnoreCache, boolean loadTombstone) {
    Object result;
    try {
      result = getDatabase().load(this, iFetchPlan, iIgnoreCache, loadTombstone, OStorage.LOCKING_STRATEGY.DEFAULT);
    } 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

    return this;
  }

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

    try {
      final ORecord result = getDatabase().load(this);

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

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

    return reload(null, true);
  }

  public ORecord reload(final String iFetchPlan, final boolean iIgnoreCache) {
    if (!getIdentity().isValid())
      throw new ORecordNotFoundException("The record has no id. It is probably new or still transient");

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

      return this;
    } catch (Exception e) {
      throw new ORecordNotFoundException("The record with id '" + getIdentity() + "' not found", e);
    }
  }
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");

       iResponse.writeRecord(record);

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

  public OStorageOperationResult<Boolean> delete(final ORecordId rid, final ORecordVersion iVersion, final boolean iRequired,
      final int iMode) {
    try {
      final OStorageOperationResult<Boolean> result = storage.deleteRecord(rid, iVersion, iMode, null);
      if (!result.getResult() && iRequired)
        throw new ORecordNotFoundException("The record with id " + rid + " was not found");
      return result;
    } catch (OException e) {
      // PASS THROUGH
      throw e;
    } catch (Exception e) {
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.