Package com.orientechnologies.orient.core.exception

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


    return connection.database;
  }

  protected void createDatabase(final ODatabaseDocumentTx iDatabase, String dbUser, String dbPasswd) {
    if (iDatabase.exists())
      throw new ODatabaseException("Database '" + iDatabase.getURL() + "' already exists");

    for (OStorage stg : Orient.instance().getStorages()) {
      if (stg.getName().equalsIgnoreCase(iDatabase.getName()) && stg.exists())
        throw new ODatabaseException("Database '" + iDatabase.getURL() + "' already exists: " + stg);
    }

    iDatabase.create();
    if (dbUser != null) {
View Full Code Here


    return new ORecordId(clusterId, clusterPosition);
  }

  private void checkClusterLimits() {
    if (clusterId < -1)
      throw new ODatabaseException("RecordId can't support negative cluster id. You've used: " + clusterId);

    if (clusterId > CLUSTER_MAX)
      throw new ODatabaseException("RecordId can't support cluster id major than 32767. You've used: " + clusterId);
  }
View Full Code Here

    return this;
  }

  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 {
View Full Code Here

    return reload(null, true);
  }

  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 {
View Full Code Here

    }
  }

  public ORecordAbstract<T> save() {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record. Create it using the <DB>.newInstance()");

    _database.save(this);

    return this;
  }
View Full Code Here

    return this;
  }

  public ORecordAbstract<T> save(final String iClusterName) {
    if (_database == null)
      throw new ODatabaseException("No database assigned to current record. Create it using the <DB>.newInstance()");

    _database.save(this, iClusterName);

    return this;
  }
View Full Code Here

    return this;
  }

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

    _database.delete(this);
    setDirty();
    return this;
  }
View Full Code Here

      // SET DEFAULT PROPERTIES
      setProperty("fetch-max", 50);

    } catch (Throwable t) {
      throw new ODatabaseException("Error on opening database '" + iURL + "'", t);
    }
  }
View Full Code Here

      status = STATUS.OPEN;
    } catch (OException e) {
      // PASS THROUGH
      throw e;
    } catch (Exception e) {
      throw new ODatabaseException("Can't open database", e);
    }
    return (DB) this;
  }
View Full Code Here

        } catch (Throwable t) {
        }

      status = STATUS.OPEN;
    } catch (Exception e) {
      throw new ODatabaseException("Can't create database", e);
    }
    return (DB) this;
  }
View Full Code Here

TOP

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

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.