Hi there,
I am trying to map a table field which in postgres has a column definition set to text[].
Tried messing around with converters, ( got them to work for jsonb) , but not with text arrays.
Getting this exception:
java.lang.ClassCastException: class [Ljava.lang.String; cannot be cast to class org.postgresql.util.PGobject ([Ljava.lang.String; is in module java.base of loader ‘bootstrap’; org.postgresql.util.PGobject is in unnamed module of loader ‘app’)
at it.topcs.controlroom.entity.TextArrayConverter.convertToEntityAttribute(TextArrayConverter.java:11)
In entity class this is how the column is defined:
@Converter(name = “TextArrayConverter”, converterClass = TextArrayConverter.class)
@Convert(converter = TextArrayConverter.class)
@Column(name = “days_of_week_ranges”,columnDefinition = “text[]”)
private String daysOfWeekRanges;
Attached is the converter class
TextArrayConverter.java (865 Bytes)
I am probably doing something wrong, but have no clue. Can you help ?