Artyom Gornostayev
03/28/2024, 11:26 AM@GeneratedValue
?
I'm using Micronaut Data with R2DBC.
I have a class:
data class Product(
@Id
@GeneratedValue
var id: Long? = null,
val publicId: UUID,
val code: String,
...
)
When I'm trying to save a new record (id = null
) with repository.save(product)
the exception has thrown...
null value in column "id" of relation "products" violates not-null constraint
I'm not sure what is wrong...bob
06/04/2024, 11:32 AMsave
it always generates a new UUID, but on update
it uses it. But yeah, it's not a perfect match to always be forced to have a random value in it.
Disclaimer, I haven't tested any further than passing by.Artyom Gornostayev
06/04/2024, 3:11 PM