/** * Should be used only by console commands */ public void loadRecordInternal(String iRecordId, String iFetchPlan) { checkForDatabase(); currentRecord = currentDatabase.load(new ORecordId(iRecordId), iFetchPlan); displayRecord(null); message("\nOK"); }
/** * Should be used only by console commands */ public void reloadRecordInternal(String iRecordId, String iFetchPlan) { checkForDatabase(); currentRecord = currentDatabase .executeReadRecord(new ORecordId(iRecordId), null, -1, iFetchPlan, true, false, false, OStorage.LOCKING_STRATEGY.NONE, new SimpleRecordReader(false)); displayRecord(null); message("\nOK"); }
@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); } }
@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"); } }