I have a table which contains a column of type: integer[]
I'm trying to map my entity to this table and I've tried the following suggestion of:
@ElementCollection
private ArrayList<Integer> col;
public MyEntity() {
col = new ArrayList<>();
}
However I get the following error: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements
Not sure how to get around this. I'm open to changing the entity's datatype, but I would prefer not to move this property into its own table/entity. Is there another solution? Thanks.