0

你将如何注释这个 bean 以在 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;
}

每个performanceValues实体都有一个唯一的map,每个map只能关联一个PerformanceValues(我猜这是oneToOne的关系)

谢谢

4

0 回答 0