Rob Elliot
02/19/2021, 11:18 AM@Entity data class MyImmutableEntity(val jsonString: String) {
@javax.persistence.Transient private val jsonMap: Map<String, Any> by lazy {
jacksonObjectMapper().readValue(jsonString)
}
fun getJsonMap(): Map<String, Any> = jsonMap
}
The compiler complains about @Transient - This annotation is not applicable to target 'member property with delegate'.
Anyone know of a workaround for this?Robert Jaros
02/19/2021, 11:50 AMgetJsonMap() function, something like that:
return jsonMap ?: run {
jsonMap = jacksonObjectMapper().readValue(jsonString)
jsonMap
}Rob Elliot
02/19/2021, 12:09 PMRobert Jaros
02/19/2021, 12:22 PM@delegate:Transient ?Robert Jaros
02/19/2021, 12:24 PMRob Elliot
02/19/2021, 12:37 PMRob Elliot
02/22/2021, 11:26 AMcarlos
12/17/2021, 11:44 AMJPAConverter instead of having the objectMapper inside my entity.carlos
12/17/2021, 11:45 AMcarlos
12/17/2021, 11:45 AMRob Elliot
12/17/2021, 11:51 AMcarlos
12/17/2021, 11:54 AMcarlos
12/17/2021, 11:54 AM