forked from maiora/backend-api
modifica tipi ID
da integer a long
This commit is contained in:
parent
488cab4ac7
commit
af2b7cea6d
@ -28,9 +28,9 @@ object ParametriTable : IdTable<Int>("parametri"){
|
||||
override val primaryKey = PrimaryKey(id)
|
||||
}
|
||||
|
||||
object TessereTable : IdTable<Int>("view_tessere_api"){
|
||||
override val id = integer("id").entityId()
|
||||
val idUtente = integer("id_utente")
|
||||
object TessereTable : IdTable<Long>("view_tessere_api"){
|
||||
override val id = long("id").entityId()
|
||||
val idUtente = long("id_utente")
|
||||
val codiceFiscale = varchar("codice_fiscale", 255)
|
||||
val numero = varchar("numero", 255)
|
||||
val saldo = double("saldo")
|
||||
@ -53,8 +53,8 @@ class ParametriDAO(id: EntityID<Int>) :IntEntity(id) {
|
||||
var valore by ParametriTable.valore
|
||||
}
|
||||
|
||||
class TessereDao(id: EntityID<Int>) :IntEntity(id) {
|
||||
companion object : IntEntityClass<TessereDao>(TessereTable)
|
||||
class TessereDao(id: EntityID<Long>) :LongEntity(id) {
|
||||
companion object : LongEntityClass<TessereDao>(TessereTable)
|
||||
|
||||
var idUtente by TessereTable.idUtente
|
||||
var codiceFiscale by TessereTable.codiceFiscale
|
||||
|
@ -4,8 +4,8 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Tessere(
|
||||
val id: Int,
|
||||
val idUtente : Int,
|
||||
val id: Long,
|
||||
val idUtente : Long,
|
||||
val codiceFiscale : String,
|
||||
val numero : String,
|
||||
val saldo : Double,
|
||||
|
@ -7,7 +7,7 @@ class TessereRepositoryImpl : TessereRepository {
|
||||
// Cerca tessere in base al codice fiscale
|
||||
TessereDao.find { TessereTable.codiceFiscale eq cf }
|
||||
.singleOrNull() // Restituisce un singolo risultato o null se non trovato
|
||||
?.let { tessereDaoToModel(it) } // Converte il DAO in un oggetto Accounts
|
||||
?.let { tessereDaoToModel(it) } // Converte il DAO in un oggetto Tessere
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user