1

Have 1 PostgreSQL table look like following

int     id,
int[]   childIds

How can I map childIds to a List in Java entity?

class A {
       @Id
       @GeneratedValue(strategy = GenerationType.IDENTITY)
       @Column
       private int id;

       @Type(type = "int-array")   
       @Column(name = "childIds")
       private List<Integer> childIds;
}

 

Got following error when trying to build the code

Caused by: java.lang.ClassNotFoundException: Could not load requested class : int-array
user8355591
  • 181
  • 1
  • 10
  • Does this answer your question? [Mapping array with Hibernate](https://stackoverflow.com/questions/4332467/mapping-array-with-hibernate) – donquih0te Sep 13 '20 at 08:32

0 Answers0