java - Mapping array with Hibernate -
can please me map th class hbernate?
public class myclass{ private long id; private string name; private int[] values; ... }
i'm using postgresql , column type n table integer[] how array should mapped?
i have never mapped arrays hibernate. use collections. so, have changed class:
public class myclass{ private long id; private string name; private list<integer> values; @id // if id auto generated @generatedvalue(strategy=generationtype.auto) public long getid() { return id; } @onetomany(cascade=cascadetype.all, fetch=fetchtype.lazy) public list<integer> getvalues() { return values; } ...
Comments
Post a Comment