I have a two beans. 1. ServerInstance. following are the fields
a.name b.url c. adminName d.password. ==> ORM mapping for this is simple and good.
But 2 bean 2.* UserMapping*. following are the fields
a. userName b. Map<ServerInstance, Set<String>> ==> for this i am not able to map. i tried with @ElementColections , but no use. and i also i would like to specify Set<String> as Embeddable and map it.even failed in that.
my mapping table should look some thing like the following . In 3rd table 3 columns will act as compound PK
|ID|NAME|URL|USERNAME|PASSORD| |ID|USERNAME| |SERVER_ID|MAP_ID |PKEY|
|1 |ONE |http://dsddsa|name|passrd| |10|TESTUSER| |1 |10 |PRJ1|
|1 |10 |PRJ1|
thanks in advance
There isn't a way to map collections of collections in JPA. The only way I can think of is to map the relation table as an entity that itself has an element collection mapping. You can then use a OneToMany mapping to this relationtable entity specifying the ServerInstance as the map key.