Add Serializer
This commit is contained in:
16
src/main/kotlin/fr/postgresjson/entity/Entity.kt
Normal file
16
src/main/kotlin/fr/postgresjson/entity/Entity.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package fr.postgresjson.entity
|
||||
|
||||
import java.util.*
|
||||
|
||||
interface EntityI<T> {
|
||||
var id: T
|
||||
}
|
||||
abstract class Entity<T>(override var id: T) : EntityI<T>
|
||||
abstract class UuidEntity(override var id: UUID = UUID.randomUUID()) : Entity<UUID>(id) {}
|
||||
abstract class IdEntity(override var id: Int) : Entity<Int>(id)
|
||||
|
||||
interface EntityVersioning<T> {
|
||||
var version: T
|
||||
}
|
||||
|
||||
interface EntityVersioningIncrement : EntityVersioning<Int>
|
||||
Reference in New Issue
Block a user