Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 789 Bytes
package com.example.demo.persistence
import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.stereotype.Repository
class VehicleCustomRepositoryImpl(
private val redisTemplate: RedisTemplate<String, Any>,
private val objectMapper: ObjectMapper
) : VehicleCustomRepository {
override fun save(vehicleEntity: VehicleEntity) {
redisTemplate.opsForValue().set(, vehicleEntity);
override fun findById(id: String): VehicleEntity {
return redisTemplate.opsForValue().get(id)?.let {
} ?: throw VehicleNotFoundException("No vehicle for id = '$id' has been found.")
You can’t perform that action at this time.