DataClassRepository

class DataClassRepository(areasDatabaseDao: AreasDatabaseDao, zonesDatabaseDao: ZonesDatabaseDao, sectorsDatabaseDao: SectorsDatabaseDao, pathsDatabaseDao: PathsDatabaseDao)

Constructors

Link copied to clipboard
fun DataClassRepository(areasDatabaseDao: AreasDatabaseDao, zonesDatabaseDao: ZonesDatabaseDao, sectorsDatabaseDao: SectorsDatabaseDao, pathsDatabaseDao: PathsDatabaseDao)

Functions

Link copied to clipboard
suspend fun <D : DataRoot<*>> add(item: D): DataClassRepository

Adds something to the corresponding list according to D.

suspend fun add(area: AreaData)
suspend fun add(path: PathData)
suspend fun add(sector: SectorData)
suspend fun add(zone: ZoneData)
Link copied to clipboard
suspend fun <D : DataRoot<*>> addAll(items: Iterable<D>): DataClassRepository

Adds all the elements of items to the corresponding list according to its type.

Link copied to clipboard
suspend fun clearAreas()
Link copied to clipboard
suspend fun clearPaths()
Link copied to clipboard
suspend fun clearSectors()
Link copied to clipboard
suspend fun clearZones()
Link copied to clipboard
suspend fun delete(area: AreaData)
suspend fun delete(path: PathData)
suspend fun delete(sector: SectorData)
suspend fun delete(zone: ZoneData)
Link copied to clipboard
suspend fun deleteFromParentId(namespace: Namespace, parentObjectId: String)

Deletes all the elements at namespace with parent an element with id parentObjectId.

Link copied to clipboard
suspend fun find(query: String): List<DataRoot<*>>

Searches in areas, zones, sectors and paths for the query. Display name, object id, or web url. Display name may contain query, others must match.

suspend fun find(namespace: Namespace, objectId: String): DataRoot<out DataClassImpl>?

Finds a DataClass from its namespace and objectId. May return null if the target is not found.

Link copied to clipboard
suspend fun get(namespace: Namespace, objectId: String): DataRoot<out DataClassImpl>?

Gets a DataClass from its namespace and objectId.

Link copied to clipboard
suspend fun getAll(namespace: Namespace): List<DataRoot<out DataClassImpl>>

Gets all the elements there are in the set namespace.

Link copied to clipboard
suspend fun getArea(objectId: String): AreaData?
Link copied to clipboard
suspend fun getAreas(): List<AreaData>
Link copied to clipboard
suspend fun getChildren(namespace: Namespace, objectId: String): List<DataRoot<out DataClassImpl>>?

Gets the children elements of the element in namespace with id objectId.

Link copied to clipboard
suspend fun getPath(objectId: String): PathData?
Link copied to clipboard
suspend fun getPaths(): List<PathData>
Link copied to clipboard
suspend fun getSector(objectId: String): SectorData?
Link copied to clipboard
suspend fun getSectors(): List<SectorData>
Link copied to clipboard
suspend fun getZone(objectId: String): ZoneData?
Link copied to clipboard
suspend fun getZones(): List<ZoneData>
Link copied to clipboard
suspend fun <D : DataRoot<*>> update(item: D): DataClassRepository

Runs update on the specific dao according to D.

suspend fun update(area: AreaData)
suspend fun update(path: PathData)
suspend fun update(sector: SectorData)
suspend fun update(zone: ZoneData)
Link copied to clipboard
suspend fun updateAll(items: List<DataRoot<*>>)

Updates all the elements from items into the database.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard