Hi.
I have 3 tables:
customer(id, name),
settings(id, name, value),
settings_ssl(customer_id, setting_id)I have 2 classes:
Customer,
Settings mapped to the corresponding tables.
I want Customer to have Map of Settings ( to use:
Customer.getSettings().get("property").getValue(); ) but can't.
The Set works fine:
Code:
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "settings_ssl", joinColumns = {@JoinColumn(name = "customer_id")}, inverseJoinColumns = {@JoinColumn(name = "setting_id")})
public Set<Stting> getSettings() {...}
I've tried
@MapKey(name="name") annotation after the Set's one, however without success.
Also fount that this is possible using
@MapKeyJoinColumn annotation, however I'm on Hibernate 3.4 and it has no such.
Could anyone advice me the solution.
Thanks in advance.