I use Postgres in my application. I have a table where I store list of string in a column which is of type text[]. I want to use the Spring JPA Specification API to search the elements in the column.
I would like to use Specification API to search a list of entities where industries are in ['a', 'b', 'c']. This is how my entity class looks like.
@Setter
@Getter
@Entity
@Table(name = "TABLE_NAME")
@TypeDef(name = "list-array", typeClass = ListArrayType.class)
public class TableEntity {
@Id
@Column(name = "ID", nullable = false)
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@Type(type = "list-array")
@Column(name = "INDUSTRIES", columnDefinition = "text[]")
private List<String> industries;
}