If you are working with Maps in a Pojo and if you are using a primitive datatype as the map's values. You can configure it using the @Column definition itself. Is in't that wierd :-)
@CollectionOfElements
@org.hibernate.annotations.MapKey(columns = { @Column(name = "keyName") })
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@JoinTable(name = "map_table", joinColumns = @JoinColumn(name = "key_name_id"))
@Column(length = 1024)
public Map<KeyObject, String> getMapObjects() {
return mapObject;
}
|
Recent comments
6 days 16 hours ago
28 weeks 5 days ago
29 weeks 6 days ago