Examples of ORecordId


Examples of com.orientechnologies.orient.core.id.ORecordId

      case OTransactionRecordEntry.DELETED:
        database.executeDeleteRecord(iRecord, iRecord.getVersion());
        break;
      }
    } else {
      final ORecordId rid = (ORecordId) iRecord.getIdentity();

      if (!rid.isValid()) {
        // // TODO: NEED IT FOR REAL?
        // // NEW RECORD: CHECK IF IT'S ALREADY IN
        // for (OTransactionRecordEntry entry : recordEntries.values()) {
        // if (entry.getRecord() == iRecord)
        // return;
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

   */
  private int recoverTransaction(final int iTxId) throws IOException {
    final OPhysicalPosition ppos = new OPhysicalPosition();

    int recordsRecovered = 0;
    final ORecordId rid = new ORecordId();

    final int size = (file.getFilledUpTo() / RECORD_SIZE);
    for (int i = 0; i < size; ++i) {
      int offset = i * RECORD_SIZE;

 
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

  public synchronized OIndex createIndex(final String iName, final String iType, final OType iKeyType,
      final int[] iClusterIdsToIndex, OIndexCallback iCallback, final OProgressListener iProgressListener, final boolean iAutomatic) {
    final String text = String.format(QUERY_CREATE, iName, iType, iKeyType);
    getDatabase().command(new OCommandSQL(text)).execute();

    document.setIdentity(new ORecordId(document.getDatabase().getStorage().getConfiguration().indexMgrRecordId));
    reload();

    return indexes.get(iName.toLowerCase());
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

    checkOpeness();

    if (!iRecord.isDirty())
      return;

    final ORecordId rid = (ORecordId) iRecord.getIdentity();

    if (rid == null)
      throw new ODatabaseException(
          "Can't create record because it has no identity. Probably is not a regular record or contains projections of fields rather than a full record");

    setCurrentDatabaseinThreadLocal();

    if (iRecord.getDatabase() == null)
      iRecord.setDatabase(this);

    try {
      boolean wasNew = rid.isNew();

      // STREAM.LENGTH == 0 -> RECORD IN STACK: WILL BE SAVED AFTER
      byte[] stream = iRecord.toStream();

      boolean isNew = rid.isNew();
      if (isNew)
        // NOTIFY IDENTITY HAS CHANGED
        iRecord.onBeforeIdentityChanged(rid);
      else if (stream.length == 0)
        // ALREADY CREATED AND WAITING FOR THE RIGHT UPDATE (WE'RE IN A GRAPH)
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

    }
  }

  public void executeDeleteRecord(final OIdentifiable iRecord, final int iVersion) {
    checkOpeness();
    final ORecordId rid = (ORecordId) iRecord.getIdentity();

    if (rid == null)
      throw new ODatabaseException(
          "Can't delete record because it has no identity. Probably was created from scratch or contains projections of fields rather than a full record");

    if (!rid.isValid())
      return;

    checkSecurity(ODatabaseSecurityResources.CLUSTER, ORole.PERMISSION_DELETE, getClusterNameById(rid.clusterId));

    setCurrentDatabaseinThreadLocal();
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

    if (iPojo == null)
      return this;

    ODocument record = getRecordByUserObject(iPojo, false);
    if (record == null) {
      final ORecordId rid = OObjectSerializerHelper.getObjectID(this, iPojo);
      if (rid == null)
        throw new OObjectNotDetachedException("Can't retrieve the object's ID for '" + iPojo + "' because hasn't been detached");

      record = (ODocument) underlying.load(rid);
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

   * Delete all the temporary records created to fill the holes and to mantain the same record ID
   */
  private void deleteHoleRecords() {
    listener.onMessage("\nDelete temporary records...");

    final ORecordId rid = new ORecordId();
    final ODocument doc = new ODocument(database, rid);
    for (String recId : recordToDelete) {
      doc.reset();
      rid.fromString(recId);
      doc.delete();
    }
    listener.onMessage("OK (" + recordToDelete.size() + " records)");
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

                value = value.substring(1, value.length() - 1);

              final Collection<String> rids = OStringSerializerHelper.split(value, ',', new char[] { '#', '"' });

              for (String rid : rids) {
                doc.setIdentity(new ORecordId(rid));
                index.put(key, doc);
              }
            }

          tot++;
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

    long total = 0;

    jsonReader.readNext(OJSONReader.BEGIN_COLLECTION);

    @SuppressWarnings("unused")
    ORecordId rid = null;
    while (jsonReader.lastChar() != ']') {
      jsonReader.readNext(OJSONReader.BEGIN_OBJECT);

      String name = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"name\"")
          .readString(OJSONReader.COMMA_SEPARATOR);

      if (name.length() == 0)
        name = null;

      if (name != null)
        // CHECK IF THE CLUSTER IS INCLUDED
        if (includeClusters != null) {
          if (!includeClusters.contains(name)) {
            jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
            continue;
          }
        } else if (excludeClusters != null) {
          if (excludeClusters.contains(name)) {
            jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
            continue;
          }
        }

      int id = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"id\"").readInteger(OJSONReader.COMMA_SEPARATOR);
      String type = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"type\"")
          .readString(OJSONReader.NEXT_IN_OBJECT);

      if (jsonReader.lastChar() == ',') {
        rid = new ORecordId(jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"rid\"")
            .readString(OJSONReader.NEXT_IN_OBJECT));
      } else
        rid = null;

      listener.onMessage("\n- Creating cluster " + (name != null ? "'" + name + "'" : "NULL") + "...");
View Full Code Here

Examples of com.orientechnologies.orient.core.id.ORecordId

      }
      fieldValue = coll;

    } else if (iValue.charAt(0) == ORID.PREFIX)
      // RID
      fieldValue = new ORecordId(iValue.trim());
    else {

      final String upperCase = iValue.toUpperCase();
      if (upperCase.equals("NULL"))
        // NULL
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.