public ORecordId(final String iRecordId) { fromString(iRecordId); }
/** * (Blueprints Extension) Fills the Element from a byte[] * * @param stream byte array representation of the object * @throws OSerializationException */ @Override public OSerializableStream fromStream(final byte[] stream) throws OSerializationException { final ODocument record = getRecord(); ((ORecordId) record.getIdentity()).fromString(new String(stream)); return this; }
@Override public List<T> findAll(Iterable<String> ids) { List<ORecordId> oRecordIds = new ArrayList<>(); for (String id : ids) { ORecordId oRecordId = new ORecordId(); oRecordId.fromString(id); oRecordIds.add(oRecordId); } return operations.query(getQuery("?", null), oRecordIds); }
@Override public List<T> findAll(Iterable<String> ids) { List<ORecordId> oRecordIds = new ArrayList<>(); for (String id : ids) { ORecordId oRecordId = new ORecordId(); oRecordId.fromString(id); oRecordIds.add(oRecordId); } return operations.query(getQuery("?", null), oRecordIds); }
@Override public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException { final ODocument record = getRecord(); ((ORecordId) record.getIdentity()).fromString(new String(iStream)); record.setInternalStatus(STATUS.NOT_LOADED); return this; }
@Override public Iterable<OIdentifiable> searchFromTarget(OFromClause target, OBinaryCompareOperator operator, Object rightValue, OCommandContext ctx, OExpression... args) { OLuceneFullTextIndex index = this.searchForIndex(target, ctx); if (index == null) return Collections.emptySet(); IndexSearcher searcher = index.searcher(); OExpression expression = args[0]; ODocument metadata = parseMetadata(args); List<String> ridsAsString = parseRids(ctx, expression); List<ORecord> others = ridsAsString.stream().map(rid -> { ORecordId recordId = new ORecordId(); recordId.fromString(rid); return recordId; }).map(id -> id.<ORecord>getRecord()).collect(Collectors.toList()); MoreLikeThis mlt = buildMoreLikeThis(index, searcher, metadata); Builder queryBuilder = new Builder(); excludeOtherFromResults(ridsAsString, queryBuilder); addLikeQueries(others, mlt, queryBuilder); Query mltQuery = queryBuilder.build(); Set<OIdentifiable> luceneResultSet = index .get(new OLuceneKeyAndMetadata(new OLuceneCompositeKey(Arrays.asList(mltQuery.toString())).setContext(ctx), metadata)); return luceneResultSet; }
return this; } else if (ODocumentHelper.ATTRIBUTE_RID.equals(iFieldName)) { _recordId.fromString(iPropertyValue.toString()); return this; } else if (ODocumentHelper.ATTRIBUTE_VERSION.equals(iFieldName)) {
return; } else if (ODocumentHelper.ATTRIBUTE_RID.equals(iPropetyName)) { _recordId.fromString(iPropertyValue.toString()); return; } else if (ODocumentHelper.ATTRIBUTE_VERSION.equals(iPropetyName)) {
public OSchemaShared load(ODatabaseDocumentInternal database) { rwSpinLock.acquireWriteLock(); try { if (!new ORecordId(database.getStorage().getConfiguration().getSchemaRecordId()).isValid()) throw new OSchemaNotCreatedException("Schema is not created and cannot be loaded"); ((ORecordId) document.getIdentity()).fromString(database.getStorage().getConfiguration().getSchemaRecordId()); reload("*:-1 index:0"); return this; } finally { rwSpinLock.releaseWriteLock(); } }
public OIndexManagerAbstract load(ODatabaseDocumentInternal database) { if (!autoRecreateIndexesAfterCrash(database)) { acquireExclusiveLock(); try { if (database.getStorage().getConfiguration().getIndexMgrRecordId() == null) // @COMPATIBILITY: CREATE THE INDEX MGR create(database); // RELOAD IT ((ORecordId) document.getIdentity()).fromString(database.getStorage().getConfiguration().getIndexMgrRecordId()); super.reload("*:-1 index:0"); } finally { releaseExclusiveLock(); } } return this; }