Skip to content

Commit

Permalink
Refaktorer siden databasefeltet kun aksepterer string
Browse files Browse the repository at this point in the history
  • Loading branch information
johatr committed Feb 29, 2024
1 parent 397d54b commit f7f1089
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package no.nav.veilarboppfolging.repository

import no.nav.veilarboppfolging.utils.DbUtils.hentZonedDateTime
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.jdbc.core.JdbcTemplate
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
import org.springframework.stereotype.Repository
import java.sql.ResultSet
Expand All @@ -18,7 +15,7 @@ open class SakRepository(val db: NamedParameterJdbcTemplate) {
return db.query("""
SELECT * FROM SAK WHERE OPPFOLGINGSPERIODE_UUID = :oppfølgingsperiodeUUID
""".trimIndent(),
mapOf("oppfølgingsperiodeUUID" to oppfølgingsperiodeUUID),
mapOf("oppfølgingsperiodeUUID" to oppfølgingsperiodeUUID.toString()),
SakEntity::fromResultSet

)
Expand All @@ -30,7 +27,7 @@ open class SakRepository(val db: NamedParameterJdbcTemplate) {
INSERT INTO SAK (oppfolgingsperiode_uuid, created_at)
VALUES(:oppfølgingsperiodeUUID, CURRENT_TIMESTAMP)
""".trimIndent(),
mapOf("oppfølgingsperiodeUUID" to oppfølgingsperiodeUUID),
mapOf("oppfølgingsperiodeUUID" to oppfølgingsperiodeUUID.toString()),
)
}

Expand Down

0 comments on commit f7f1089

Please sign in to comment.