app / de.uniks.codliners.stock_simulator.database / TransactionDao

TransactionDao

interface TransactionDao

Dao that manages Transactions in the database.

Author
Juri Lozowoj

Functions

deleteTransactions

Deletes all Transactions from the database.

abstract fun deleteTransactions(): Unit

getTransactions

Returns all Transactions as a List, wrapped in LiveData, ordered be their date Long, in descending order.

abstract fun getTransactions(): LiveData<List<Transaction>>

getTransactionsById

Returns all Transactions matching the id as a List, wrapped in LiveData.

abstract fun getTransactionsById(id: String): LiveData<List<Transaction>>

getTransactionsLimited

Returns the last {limit} Transactions as a List, wrapped in LiveData.

abstract fun getTransactionsLimited(limit: Int): LiveData<List<Transaction>>

insert

Inserts the given Transaction into the database.

abstract fun insert(transaction: Transaction): Unit