Created
January 14, 2024 20:44
-
-
Save diogodanielsoaresferreira/c1f7c028efa7c6bb8c5d5291f383f91f to your computer and use it in GitHub Desktop.
Message repository adapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
class MessageRepositoryImpl( | |
@Autowired private val jdbcTemplate: JdbcTemplate | |
): MessageRepository { | |
private val logger: Logger = LoggerFactory.getLogger(this.javaClass) | |
override fun save(entity: Message) { | |
val insertQuery = """ | |
INSERT INTO public.message(message_timestamp, message_value) | |
VALUES (?, ?, ?) | |
""".trimIndent() | |
jdbcTemplate.update(insertQuery, entity.timestamp, entity.value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment