Interface PersistenceInterface
-
public interface PersistenceInterface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends PersistentRecord>
TcreateNew(RecordMeta<T> meta)
Creates a new instance of this type of PersistentRecord.<T extends PersistentRecord>
TcreateNew(RecordMeta<T> meta, SDataSet owner)
Creates a new instance of this type of PersistentRecord that will be a member of the given SDataSet.<T extends PersistentRecord>
Tfind(RecordMeta<T> meta, java.lang.Object... primaryKeys)
Tries to find a record with the given keys.<T extends PersistentRecord>
Tfind(SDataSet owner, RecordMeta<T> meta, java.lang.Object... primaryKeys)
Tries to find a record with the given keys.PersistenceSession
getSession()
PersistenceSession
getSession(SDataSet dataset)
void
notifyRecordAdded(PersistentRecord record)
Notifies any listeners of the record's RecordMeta type across the cluster that the record has been added.void
notifyRecordDeleted(RecordMeta<?> recordType, KeyValue key)
Notifies any listeners of the record's RecordMeta type across the cluster that the record has been deleted.void
notifyRecordUpdated(PersistentRecord record)
Notifies any listeners of the record's RecordMeta type across the cluster that the record has been updated.<T extends PersistentRecord>
java.util.List<T>query(SQuery<T> query)
<T extends PersistentRecord>
TqueryOne(SQuery<T> query)
Returns the first result from the query, or null if there were no resultsvoid
save(PersistentRecord record)
Saves a previously loaded PersistentRecord instance with any changes back to the internal database
-
-
-
Method Detail
-
getSession
PersistenceSession getSession()
-
getSession
PersistenceSession getSession(SDataSet dataset)
-
createNew
<T extends PersistentRecord> T createNew(RecordMeta<T> meta)
Creates a new instance of this type of PersistentRecord. Doesn't add to the database.
-
createNew
<T extends PersistentRecord> T createNew(RecordMeta<T> meta, SDataSet owner)
Creates a new instance of this type of PersistentRecord that will be a member of the given SDataSet. Doesn't add to the database.
-
save
void save(PersistentRecord record) throws SException
Saves a previously loaded PersistentRecord instance with any changes back to the internal database- Throws:
SException
-
find
<T extends PersistentRecord> T find(RecordMeta<T> meta, java.lang.Object... primaryKeys)
Tries to find a record with the given keys. Returns null if no matching record is found
-
find
<T extends PersistentRecord> T find(SDataSet owner, RecordMeta<T> meta, java.lang.Object... primaryKeys)
Tries to find a record with the given keys. Returns null if no matching record is found
-
query
@Nonnull <T extends PersistentRecord> java.util.List<T> query(SQuery<T> query)
-
queryOne
<T extends PersistentRecord> T queryOne(SQuery<T> query)
Returns the first result from the query, or null if there were no results
-
notifyRecordAdded
void notifyRecordAdded(PersistentRecord record) throws java.lang.Exception
Notifies any listeners of the record's RecordMeta type across the cluster that the record has been added.- Throws:
java.lang.Exception
-
notifyRecordUpdated
void notifyRecordUpdated(PersistentRecord record) throws java.lang.Exception
Notifies any listeners of the record's RecordMeta type across the cluster that the record has been updated.- Throws:
java.lang.Exception
-
notifyRecordDeleted
void notifyRecordDeleted(RecordMeta<?> recordType, KeyValue key) throws java.lang.Exception
Notifies any listeners of the record's RecordMeta type across the cluster that the record has been deleted.- Throws:
java.lang.Exception
-
-