refactoring: EntitiesCollections & add EntityI.className
This commit is contained in:
@@ -2,7 +2,7 @@ package fr.postgresjson.repository
|
||||
|
||||
import fr.postgresjson.Serializer
|
||||
import fr.postgresjson.connexion.Requester
|
||||
import fr.postgresjson.entity.EntityCollection
|
||||
import fr.postgresjson.entity.EntitiesCollections
|
||||
import fr.postgresjson.entity.EntityI
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@@ -17,7 +17,7 @@ abstract class Repository<T, E : EntityI<T?>>(override val entityName: KClass<E>
|
||||
|
||||
fun <T> findById(id: T): EntityI<T?>? {
|
||||
val sql = requester.getQuery(entityName.toString())
|
||||
return when (val e = EntityCollection().get(id)) {
|
||||
return when (val e = EntitiesCollections().get(id)) {
|
||||
null -> {
|
||||
// TODO create Request
|
||||
Serializer().deserialize<T, EntityI<T?>>("""{"plop", "plip"}""")
|
||||
|
||||
Reference in New Issue
Block a user