insert
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.
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.
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
the Image object to insert.