Package com.orientechnologies.orient.core.id

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


    return result;
  }

  public ORecordId readRID() throws IOException {
    return new ORecordId(readShort(), readLong());
  }
View Full Code Here


  @ConsoleCommand(description = "Load a record in memory and set it as the current one")
  public void loadRecord(
      @ConsoleParameter(name = "record-id", description = "The unique Record Id of the record to load. If you don't have the Record Id execute a query first") String iRecordId) {
    checkCurrentDatabase();

    currentRecord = currentDatabase.load(new ORecordId(iRecordId));
    displayRecord(null);

    out.println("OK");
  }
View Full Code Here

  @ConsoleCommand(description = "Display a record as raw bytes")
  public void displayRawRecord(@ConsoleParameter(name = "rid", description = "The record id to display") final String iRecordId) {
    checkCurrentDatabase();

    ORecordId rid = new ORecordId(iRecordId);
    final ORawBuffer buffer = currentDatabase.getStorage().readRecord(currentDatabase, rid, null);

    if (buffer == null)
      throw new OException("The record has been deleted");
View Full Code Here

  public void dictionaryPut(
      @ConsoleParameter(name = "key", description = "The key to bind") final String iKey,
      @ConsoleParameter(name = "record-id", description = "The record-id of the record to bind to the key passes") final String iRecordId) {
    checkCurrentDatabase();

    currentRecord = currentDatabase.load(new ORecordId(iRecordId));
    if (currentRecord == null)
      out.println("Error: record with id '" + iRecordId + "' was not found in database");
    else {
      currentDatabase.getDictionary().put(iKey, (ODocument) currentRecord);
      displayRecord(null);
View Full Code Here

    map1.put("map2", (HashMap<?, ?>) map2);

    final Map<String, HashMap<?, ?>> map3 = new HashMap<String, HashMap<?, ?>>();
    map2.put("map3", (HashMap<?, ?>) map3);

    final ORecordId rid = (ORecordId) newDoc.save().getIdentity();

    final ODocument loadedDoc = database.load(rid);

    Assert.assertTrue(newDoc.hasSameContentOf(loadedDoc));
View Full Code Here

        }

        try {
          beginResponse(network);
          final int updatedRecords = network.readInt();
          ORecordId rid;
          for (int i = 0; i < updatedRecords; ++i) {
            rid = network.readRID();

            // SEARCH THE RECORD WITH THAT ID TO UPDATE THE VERSION
            for (OTransactionRecordEntry txEntry : allEntries) {
View Full Code Here

  public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException {
    final OMemoryInputStream buffer = new OMemoryInputStream(iStream);
    try {
      text = buffer.getAsString();
      limit = buffer.getAsInteger();
      beginRange = new ORecordId().fromStream(buffer.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
      endRange = new ORecordId().fromStream(buffer.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
      setFetchPlan(buffer.getAsString());

      byte[] paramBuffer = buffer.getAsByteArray();

      if (paramBuffer.length == 0)
View Full Code Here

        }

        try {
          beginResponse(network);
          final int updatedRecords = network.readInt();
          ORecordId rid;
          for (int i = 0; i < updatedRecords; ++i) {
            rid = network.readRID();

            // SEARCH THE RECORD WITH THAT ID TO UPDATE THE VERSION
            for (OTransactionEntry txEntry : allEntries) {
View Full Code Here

    final int classId = network.readShort();
    if (classId == OChannelBinaryProtocol.RECORD_NULL)
      return null;

    if (classId == OChannelBinaryProtocol.RECORD_RID) {
      return new ORecordId(network.readShort(), network.readLong());
    } else {
      final ORecordInternal<?> record = ORecordFactory.newInstance(network.readByte());

      if (record instanceof ORecordSchemaAware<?>)
        ((ORecordSchemaAware<?>) record).fill(iDatabase, classId, network.readRID(), network.readInt(), network.readBytes());
View Full Code Here

    database.getMetadata().getSchema().reload();

    Profile profile = (Profile) database.browseClass("Profile").next();

    final OSQLSynchQuery<Profile> query = new OSQLSynchQuery<Profile>("select from Profile where @rid = ?");
    List<Profile> result = database.query(query, new ORecordId(profile.getId()));

    Assert.assertEquals(result.size(), 1);

    database.close();
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.id.ORecordId

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.