0

How would you annotate this bean to be mapped in hibernate ?

@Entity
public class PerformanceValues implements Serializable{

    private static final long serialVersionUID = 1234850675335166109L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    //key is mass, value is distance needed
    private Map<Integer, Integer>  massToDist;
}

Each performanceValues entity has a unique map, and each map can be related to only one PerformanceValues (I guess this is a oneToOne relationship)

Thanks

facewindu
  • 705
  • 3
  • 11
  • 31
  • have you tried searching? http://stackoverflow.com/questions/3393649/storing-a-mapstring-string-using-jpa – ogzd Feb 15 '13 at 17:49
  • ok, I saw this thread but I thought it could not apply to my example. I managed to make it work, thanks – facewindu Feb 16 '13 at 18:03

0 Answers0