remove EntityI.className && RepositoryI.entityName
This commit is contained in:
@@ -1,15 +1,10 @@
|
|||||||
package fr.postgresjson.entity
|
package fr.postgresjson.entity
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore
|
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.reflect.KClass
|
|
||||||
|
|
||||||
/* ID */
|
/* ID */
|
||||||
interface EntityI {
|
interface EntityI
|
||||||
val className: KClass<EntityI>
|
|
||||||
@JsonIgnore() get() = this::class as KClass<EntityI>
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class Entity<T>(open var id: T? = null): EntityI
|
abstract class Entity<T>(open var id: T? = null): EntityI
|
||||||
open class UuidEntity(override var id: UUID? = UUID.randomUUID()): Entity<UUID>(id)
|
open class UuidEntity(override var id: UUID? = UUID.randomUUID()): Entity<UUID>(id)
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
package fr.postgresjson.repository
|
package fr.postgresjson.repository
|
||||||
|
|
||||||
import fr.postgresjson.connexion.Requester
|
import fr.postgresjson.connexion.Requester
|
||||||
import fr.postgresjson.entity.EntityI
|
|
||||||
import kotlin.reflect.KClass
|
|
||||||
|
|
||||||
interface RepositoryI<E: EntityI> {
|
interface RepositoryI {
|
||||||
val entityName: KClass<E>
|
|
||||||
var requester: Requester
|
var requester: Requester
|
||||||
fun getClassName(): String {
|
|
||||||
return entityName.simpleName!!
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Direction {
|
enum class Direction {
|
||||||
asc,
|
asc,
|
||||||
|
|||||||
Reference in New Issue
Block a user