From 21c05f72f56c3428799d60f5d0f1ea7a1d5d1b0e Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Wed, 9 Oct 2019 22:50:04 +0200 Subject: [PATCH] remove EntityI.className && RepositoryI.entityName --- src/main/kotlin/fr/postgresjson/entity/Entity.kt | 7 +------ src/main/kotlin/fr/postgresjson/repository/Repository.kt | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/fr/postgresjson/entity/Entity.kt b/src/main/kotlin/fr/postgresjson/entity/Entity.kt index 6b1e8be..8aaa066 100644 --- a/src/main/kotlin/fr/postgresjson/entity/Entity.kt +++ b/src/main/kotlin/fr/postgresjson/entity/Entity.kt @@ -1,15 +1,10 @@ package fr.postgresjson.entity -import com.fasterxml.jackson.annotation.JsonIgnore import org.joda.time.DateTime import java.util.* -import kotlin.reflect.KClass /* ID */ -interface EntityI { - val className: KClass - @JsonIgnore() get() = this::class as KClass -} +interface EntityI abstract class Entity(open var id: T? = null): EntityI open class UuidEntity(override var id: UUID? = UUID.randomUUID()): Entity(id) diff --git a/src/main/kotlin/fr/postgresjson/repository/Repository.kt b/src/main/kotlin/fr/postgresjson/repository/Repository.kt index f7566a8..4b872aa 100644 --- a/src/main/kotlin/fr/postgresjson/repository/Repository.kt +++ b/src/main/kotlin/fr/postgresjson/repository/Repository.kt @@ -1,15 +1,9 @@ package fr.postgresjson.repository import fr.postgresjson.connexion.Requester -import fr.postgresjson.entity.EntityI -import kotlin.reflect.KClass -interface RepositoryI { - val entityName: KClass +interface RepositoryI { var requester: Requester - fun getClassName(): String { - return entityName.simpleName!! - } enum class Direction { asc,