public ODictionary<ORecord> getDictionary() { return database.getDictionary(); }
@Override public ODictionary<ORecord> getDictionary() { checkOpenness(); return internal.getDictionary(); }
/** * TEMP: workaround OrientDB 2.1 issue where in-TX dictionary updates are not replicated. * * @since 3.1 */ public void replicate(final ODocument document, final EventKind eventKind) { ODictionary<ORecord> dictionary = document.getDatabase().getDictionary(); switch (eventKind) { case CREATE: case UPDATE: dictionary.put(key, document); break; case DELETE: dictionary.remove(key); break; default: break; } } }
@ConsoleCommand(description = "Remove the association in the dictionary", onlineHelp = "Console-Command-Dictionary-Remove") public void dictionaryRemove(@ConsoleParameter(name = "key", description = "The key to remove") final String iKey) { checkForDatabase(); boolean result = currentDatabase.getDictionary().remove(iKey); if (!result) message("\nEntry not found in dictionary."); else message("\nEntry removed from the dictionary."); }
@ConsoleCommand(description = "Loook up a record using the dictionary. If found, set it as the current record", onlineHelp = "Console-Command-Dictionary-Get") public void dictionaryGet(@ConsoleParameter(name = "key", description = "The key to search") final String iKey) { checkForDatabase(); currentRecord = currentDatabase.getDictionary().get(iKey); if (currentRecord == null) message("\nEntry not found in dictionary."); else { currentRecord = (ORecord) currentRecord.load(); displayRecord(null); } }
targetRecords = new ArrayList<OIdentifiable>(); final OIdentifiable value = ODatabaseRecordThreadLocal.instance().get().getDictionary().get(key); if (value != null) ((List<OIdentifiable>) targetRecords).add(value);
@ConsoleCommand(description = "Insert or modify an entry in the database dictionary. The entry is comprised of key=String, value=record-id", onlineHelp = "Console-Command-Dictionary-Put") 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") final String iRecordId) { checkForDatabase(); currentRecord = currentDatabase.load(new ORecordId(iRecordId)); if (currentRecord == null) message("\nError: record with id '" + iRecordId + "' was not found in database"); else { currentDatabase.getDictionary().put(iKey, currentRecord); displayRecord(null); message("\nThe entry " + iKey + "=" + iRecordId + " has been inserted in the database dictionary"); } }