Interface PersistenceInterface


public interface PersistenceInterface
  • Method Details

    • 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, 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, Object... primaryKeys)
      Tries to find a record with the given keys. Returns null if no matching record is found
    • query

      @Nonnull <T extends PersistentRecord> 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 Exception
      Notifies any listeners of the record's RecordMeta type across the cluster that the record has been added.
      Throws:
      Exception
    • notifyRecordUpdated

      void notifyRecordUpdated(PersistentRecord record) throws Exception
      Notifies any listeners of the record's RecordMeta type across the cluster that the record has been updated.
      Throws:
      Exception
    • notifyRecordDeleted

      void notifyRecordDeleted(RecordMeta<?> recordType, KeyValue key) throws Exception
      Notifies any listeners of the record's RecordMeta type across the cluster that the record has been deleted.
      Throws:
      Exception