I start my application creating a database model. And I cannot understand if there is any way in hibernate-jpa to save a List of strings as an array.
If I simply try to save my
List<String> someLines;
as sql
some_lines text[]
I get an error that array cannot be represented as a List.
If I put an annotation @ElementCollection
like
@ElementCollection
List<String> someLines;
another table some_elements
is expected. The same happens If I additionally put an annotation @Column
:
@Column(name = "some_lines")
@ElementCollection
List<String> someLines;
How do you usually save a simple List in DB (without creating an additional table)?