我如何在Hibernate中映射它:
Map<Day, Double> dayCounter;
Day是:
public enum Day {
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY;
}
答案 0 :(得分:1)
类似的东西:
@ElementCollection
//define your collection table using @CollectionTable
@MapKeyEnumerated(EnumType.STRING)
@MapKeyColumn(name = "day")
@Column(name = "count")
private Map<Day, Double> dayCount;