Can you please help me to map this class using Hibernate?
public class MyClass{
private Long id;
private String name;
private int[] values;
.
Hibernate (and JPA) can't directly map the PostgreSQL array type. See this question for how to proceed if you really need to retain your database structure as it is. This thread has an example of the required custom type.
If you can change your schema, you can let hibernate create an additional table to handle the collection - List
. Then, depending on the version of hibernate you are using: