This defines the structure of the functions for performing create, read, update, and delete operations on the table, including functions exclusively related to geospatial nature:
/** * Basic CRUD operations related to Geospatial */ interface CrudRepository<T, K> { /** * Creates the table */ fun createTable() /** * Insert the item */ fun insert(t: T): T /** * Get list of all the items */ fun findAll(): Iterable<T> /** * Delete all the items */ fun deleteAll(): Int /** * Get list of items in the specified box */ fun findByBoundingBox(box: PGbox2d): Iterable<T> /** * Update the location of the user */ fun updateLocation(userName: K, location: Point) }
The MessageRepository handles the actual interaction with the database; in ...