Java 类org.hibernate.annotations.MapKey 实例源码

项目:replyit-master-3.2-final    文件:ItemDTO.java   
@Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@MapKey(columns = @Column(name = "start_date", nullable = true))
@JoinTable(name = "item_price_timeline",
           joinColumns = {@JoinColumn(name = "item_id", updatable = false)},
           inverseJoinColumns = {@JoinColumn(name = "price_model_id", updatable = false)}
)
@Sort(type = SortType.NATURAL)
@Fetch(FetchMode.SELECT)
public SortedMap<Date, PriceModelDTO> getDefaultPrices() {
    return defaultPrices;
}
项目:replyit-master-3.2-final    文件:PlanItemDTO.java   
@Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@MapKey(columns = @Column(name = "start_date", nullable = true))
@JoinTable(name = "plan_item_price_timeline",
           joinColumns = {@JoinColumn(name = "plan_item_id", updatable = false)},
           inverseJoinColumns = {@JoinColumn(name = "price_model_id", updatable = false)}
)
@Sort(type = SortType.NATURAL)
@Fetch(FetchMode.SELECT)
public SortedMap<Date, PriceModelDTO> getModels() {
    return models;
}
项目:replyit-master-3.2-final    文件:PriceModelDTO.java   
@CollectionOfElements(fetch = FetchType.EAGER)
@JoinTable(name = "price_model_attribute", joinColumns = @JoinColumn(name = "price_model_id"))
@MapKey(columns = @Column(name = "attribute_name", nullable = true, length = 255))
@Column(name = "attribute_value", nullable = true, length = 255)
@Sort(type = SortType.NATURAL)
@Fetch(FetchMode.SELECT)
public SortedMap<String, String> getAttributes() {
    return attributes;
}