insert

abstract suspend fun insert(imageEntity: ImageEntity)

Inserts a new ImageEntity object into the database.

This method is intended for Room to handle basic insert operations. For insert images, use insert(image: Image) instead.


abstract suspend fun insert(geoLocationEntity: GeoLocationEntity): Long

Inserts a new GeoLocationEntity into the database.

This method is intended for Room to handle basic insert operations. For insert images, use insert(image: Image) instead.


open suspend fun insert(image: Image)

Inserts an Image object into the database, including its associated geolocation. This method uses a transaction to ensure data consistency.

It first attempts to find an existing ImageEntity with the same geolocation (latitude and longitude) using selectImageBy. If a matching ImageEntity is found (considering potential duplicates), the insertion is skipped. Otherwise, the geolocation is inserted first, and its generated ID is used to associate the inserted image.

Parameters

image

the Image object to insert.