Package com.orientechnologies.orient.core.db.record

Examples of com.orientechnologies.orient.core.db.record.OIdentifiable


    final int limit = Integer.parseInt((String) properties.get("limit"));

    long start = System.currentTimeMillis();
    currentDatabase.query(new OSQLAsynchQuery<ODocument>(iQueryText, limit, new OCommandResultListener() {
      public boolean result(final Object iRecord) {
        final OIdentifiable record = (OIdentifiable) iRecord;

        dumpRecordInTable(currentResultSet.size(), record, columns);
        currentResultSet.add(record);
        return true;
      }
View Full Code Here


  }

  protected boolean addResult(final OIdentifiable iRecord) {
    resultCount++;

    final OIdentifiable recordCopy = iRecord instanceof ORecord<?> ? ((ORecord<?>) iRecord).copy() : iRecord.getIdentity().copy();

    if (orderedFields != null || flattenTarget != null) {
      // ORDER BY CLAUSE: COLLECT ALL THE RECORDS AND ORDER THEM AT THE END
      if (tempResult == null)
        tempResult = new ArrayList<OIdentifiable>();
View Full Code Here

          final StringBuilder buffer = new StringBuilder();
          for (int items = 0; it.hasNext(); items++) {
            if (items > 0)
              buffer.append(OStringSerializerHelper.RECORD_SEPARATOR);

            final OIdentifiable item = it.next();

            linkToStream(buffer, iRecord, item);
          }

          coll.convertRecords2Links();
View Full Code Here

    if (it != null && it.hasNext()) {
      for (int items = 0; it.hasNext(); items++) {
        if (buffer.length() > 0)
          buffer.append(OStringSerializerHelper.RECORD_SEPARATOR);

        final OIdentifiable item = it.next();

        linkToStream(buffer, iRecord, item);
      }
    }
View Full Code Here

  private static OIdentifiable linkToStream(final StringBuilder buffer, final ORecordSchemaAware<?> iParentRecord, Object iLinked) {
    if (iLinked == null)
      // NULL REFERENCE
      return null;

    OIdentifiable resultRid = null;
    ORID rid;

    if (iLinked instanceof ORID) {
      // JUST THE REFERENCE
      rid = (ORID) iLinked;
View Full Code Here

      final OIndex index = db.getMetadata().getIndexManager().getIndex(urlParts[2]);
      if (index == null)
        throw new IllegalArgumentException("Index name '" + urlParts[2] + "' not found");

      final OIdentifiable record;

      if (urlParts.length > 4)
        // GET THE RECORD ID AS VALUE
        record = new ORecordId(urlParts[4]);
      else {
View Full Code Here

    Map.Entry<Object, OIdentifiable> entry = cursor.nextEntry();
    while (entry != null) {
      ODatabaseRecordThreadLocal.INSTANCE.set(baseDocumentTx);
      Integer key = (Integer) entry.getKey();

      OIdentifiable identifiable = entry.getValue();
      ODocument doc = identifiable.getRecord();

      long ts = doc.<Long> field("ts");
      if (ts > lastTs)
        lastTs = ts;
View Full Code Here

  public ODictionary(final OIndex<OIdentifiable> iIndex) {
    index = iIndex;
  }

  public <RET extends T> RET get(final String iKey) {
    final OIdentifiable value = index.get(iKey);
    if (value == null)
      return null;

    return (RET) value.getRecord();
  }
View Full Code Here

    return (RET) value.getRecord();
  }

  public <RET extends T> RET get(final String iKey, final String iFetchPlan) {
    final OIdentifiable value = index.get(iKey);
    if (value == null)
      return null;

    if (value instanceof ORID)
      return (RET) ODatabaseRecordThreadLocal.INSTANCE.get().load(((ORID) value), iFetchPlan);
View Full Code Here

    return Collections.singletonList(field + " collate " + collate.getName());
  }

  public Object getDocumentValueToIndex(final ODocument iDocument) {
    if (OType.LINK.equals(keyType)) {
      final OIdentifiable identifiable = iDocument.field(field);
      if (identifiable != null)
        return createValue(identifiable.getIdentity());
      else
        return null;
    }
    return createValue(iDocument.field(field));
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.db.record.OIdentifiable

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.