CrudRepository

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 ...

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.