I have a field in Postgres in array type:
categories | text[] | | |
How can I declare the field in the entity class?
I have tried below in Product.kt
file but it throws error [ERROR]:ERROR: relation "product_categories" does not exist
@ElementCollection
@Column(name = "categories")
var categories: List<String>? = emptyList()
My purpose is to save the string array as one field of the entity, I am not trying to do anything related "One to Many".
If you know any Java version solution and it works, I will accept the answer as well. Thanks