Created
February 17, 2019 18:12
-
-
Save juancho088/89351c7e98780aa57bb402826045f144 to your computer and use it in GitHub Desktop.
CrudRepository Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CrudRepository<T, in ID> { | |
companion object { | |
const val LIMIT: Int = 50 | |
const val MAX_LIMIT: Int = 100 | |
const val OFFSET: Int = 0 | |
const val MIN_LIMIT: Int = 0 | |
} | |
fun save(entity: T): T | |
fun findOne(id: ID): T | |
fun findAll(filters: Map<String, Any> = mapOf(), limit: Int = LIMIT, offset: Int = OFFSET): Page<T> | |
fun delete(entity: T) | |
fun exists(id: ID) | |
fun count(): Int | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment