insert
Inserts a new AdministrativeUnitNameEntity object into the database.
This method is intended for Room to handle basic insert operations. For updates to AdministrativeUnitName, use insertOrUpdate
instead.
Inserts a new GeoLocationEntity object into the database.
This method is intended for Room to handle basic insert operations. For updates to AdministrativeUnitName, use insertOrUpdate
instead.
Inserts a GeoLocation along with its associated AdministrativeUnitName. This method uses a transaction to ensure data consistency.
It calls
insertOrUpdate
to check if a similar AdministrativeUnitName (same locality and admin area) already exists in the database.If an existing AdministrativeUnitName is found but its subAdminArea is null, it's updated with the provided subAdminArea.
If no matching AdministrativeUnitName is found or the existing one has a different subAdminArea, a new AdministrativeUnitName is inserted.
Based on the result of
insertOrUpdate
(the AdministrativeUnitName entity ID), a new GeoLocationEntity is created with a foreign key reference to the corresponding AdministrativeUnitNameEntity.
Parameters
the GeoLocation data to insert.
the AdministrativeUnitName data to insert.