Kotlin value class in Spring Expression Language

30 views Asked by At

i have my value class:

@JvmInline
value class DeviceId(val value: String)

and I would like pass deviceId as a key for cache:

    @CachePut(cacheNames = ["deviceCache"], key = "#deviceId.value")
    fun save(deviceId: DeviceId, device: Device): Device {
        return repository.save(deviceId, device)
    }

but i get a error from IDE: Cannot resolve property or method 'value' (dynamic property?)

What is the correct way to pass value object in SpEL?

0

There are 0 answers