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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -