I try to map a map with key and value as value types, both using a converter (see below). Hibernate 4.3.7 does not accept attributeName = "key" but requires it to be "key.<something>" (same for the value). Is this a bug? If I use attributeName = "key.accountId" and attributeName = "value.campaignId" Hibernate tries to map the a value as a serializable type, which is wrong. Am I doing something wrong?
Is it possible that Hibernate simply does not implement this case? The implementation in CollectionPropertyHolder seems to be a bit empty... Isn't Hibernate JPA 2.1 compliant yet?
@Converts({ @Convert(attributeName = "key", converter = AccountIdConverter.class), @Convert(attributeName = "value", converter = CampaignIdConverter.class) }) @ElementCollection(fetch = FetchType.EAGER) @Fetch(FetchMode.SELECT) @CollectionTable(name = "cluster_campaign", joinColumns=@JoinColumn(name="cluster_id")) @MapKeyColumn(name = "account_id", nullable = false) @Column(name = "campaign_id", nullable = false) private Map<AccountId, CampaignId> campaignIds = Maps.newHashMap();
|