VehicleDAO

interface VehicleDAO

Database access object responsible for interaction with vehicles table of the vehicle manager database. Actual DAO instance is generated by Room library.

Functions

Link copied to clipboard
abstract fun clear(vararg vehicles: DVehicle)

Removes all the data for selected vehicles from the database

abstract fun clear(id: String): Int

Removes all the data for selected vehicle from the database

Link copied to clipboard
abstract fun getAllVehicles(): Flow<List<DVehicle>>

Queries for all vehicles saved in the database

Link copied to clipboard

Queries for all vehicles saved in the database

Link copied to clipboard
abstract fun getVehicle(id: String): DVehicle?

Queries for a vehicle with given ID

Link copied to clipboard

Queries for a vehicle with given ID

Link copied to clipboard
abstract fun insert(vararg vehicles: DVehicle)

Inserts new vehicles to the database. If vehicle with given ID already exists, the item will not be updated. See insertOrUpdate.

Link copied to clipboard
abstract fun insertOrUpdate(vararg vehicles: DVehicle)

Inserts or updates vehicles to the database. In case the vehicle with given ID is already present in the database, it's data will be updated.

Link copied to clipboard
abstract fun update(vararg vehicles: DVehicle): Int

Updates existing vehicles (with same ID parameter).