|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.user.events.EventOutcomeRecordSQLLoader
public class EventOutcomeRecordSQLLoader
Load an EventOutcomeRecord from the database. TODO: save them, too.
CREATE TABLE eventOutcomes ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, giveMedal INT NULL, CONSTRAINT FOREIGN KEY (giveMedal) REFERENCES medalTypes(ID), maxRarity TINYINT NOT NULL DEFAULT 4, minRarity TINYINT NOT NULL DEFAULT 1, CONSTRAINT FOREIGN KEY (maxRarity) REFERENCES itemRarities(ID), CONSTRAINT FOREIGN KEY (minRarity) REFERENCES itemRarities(ID), onDupe ENUM ('R','I','N') NOT NULL DEFAULT 'I', rewardPoints ENUM ('Y','N') NOT NULL DEFAULT 'Y', rewardCurrency CHAR(3) NOT NULL DEFAULT 'xTP', rewardCollectionID INT UNSIGNED NULL, CONSTRAINT FOREIGN KEY (rewardCollectionID) REFERENCES itemCollections(ID), rewardItemID INT NULL, CONSTRAINT FOREIGN KEY (rewardItemID) REFERENCES items (ID), rewardRatio DECIMAL(10,5) NOT NULL DEFAULT 00001.00000, rewardRandom ENUM ('Y','N') NOT NULL DEFAULT 'N', rewardMin DECIMAL(5,0) NOT NULL DEFAULT -99999, rewardMax DECIMAL(5,0) NOT NULL DEFAULT 99999, rewardItemType ENUM('I','C','G','N') NOT NULL DEFAULT 'N' ) ENGINE=InnoDB;
Constructor Summary | |
---|---|
EventOutcomeRecordSQLLoader()
|
Method Summary | |
---|---|
void |
changed(EventOutcomeRecord changedRecord)
accept a notification from a record that it has been changed. |
String |
getSubversionRevision()
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. |
void |
initializeStorage(String storageURL)
Prepare the RecordLoader for accessing a given storage medium. |
boolean |
isRealtime()
|
EventOutcomeRecord |
loadRecord(int id)
Load the record with the given ID number from the storage system |
EventOutcomeRecord |
loadRecord(String identifier)
Load the data record identified from the storage system. |
void |
refresh(EventOutcomeRecord record)
Refreshes the record: Re-read the contents of the database into the given record. |
void |
removeRecord(EventOutcomeRecord record)
|
void |
saveRecord(EventOutcomeRecord record)
Save a record back to the storage system |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventOutcomeRecordSQLLoader()
Method Detail |
---|
public void changed(EventOutcomeRecord changedRecord)
RecordLoader
changed
in interface RecordLoader<EventOutcomeRecord>
changedRecord
- the record that has been changedRecordLoader.changed(org.starhope.appius.util.DataRecord)
public String getSubversionRevision()
HasSubversionRevision
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
As an example,the Subversion revision string for this file is "$Rev: 1968 $"
@Override public String getSubversionRevision () { return "$Rev: "; }
getSubversionRevision
in interface HasSubversionRevision
HasSubversionRevision.getSubversionRevision()
public void initializeStorage(String storageURL) throws NotReadyException
RecordLoader
initializeStorage
in interface RecordLoader<EventOutcomeRecord>
storageURL
- A URL or identifier of the storage engine. The
syntax is specific to the RecordLoader implementation.
NotReadyException
- if the storage engine can't be
initialisedRecordLoader.initializeStorage(java.lang.String)
public boolean isRealtime()
isRealtime
in interface RecordLoader<EventOutcomeRecord>
RecordLoader.isRealtime()
public EventOutcomeRecord loadRecord(int id) throws NotFoundException
RecordLoader
loadRecord
in interface RecordLoader<EventOutcomeRecord>
id
- the ID number for the record
NotFoundException
- if the record can't be loadedRecordLoader.loadRecord(int)
public EventOutcomeRecord loadRecord(String identifier) throws NotFoundException
RecordLoader
loadRecord
in interface RecordLoader<EventOutcomeRecord>
identifier
- the identifier for the record
NotFoundException
- if the record can't be loadedRecordLoader.loadRecord(java.lang.String)
public void removeRecord(EventOutcomeRecord record)
removeRecord
in interface RecordLoader<EventOutcomeRecord>
record
- Record to be deleted/removedRecordLoader.removeRecord(org.starhope.appius.util.DataRecord)
public void saveRecord(EventOutcomeRecord record)
RecordLoader
saveRecord
in interface RecordLoader<EventOutcomeRecord>
record
- the record to be savedRecordLoader.saveRecord(org.starhope.appius.util.DataRecord)
public void refresh(EventOutcomeRecord record)
RecordLoader
SimpleDataRecord.checkStale()
to try to reload data when
it might have been changed: it's trading elegance and efficiency
for expediency, but eventually, it should be removed.
refresh
in interface RecordLoader<EventOutcomeRecord>
record
- the record to be reloaded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |