i have a rather complicate Entity, the code excerpt below
Code:
public class Region
{
@Id(generate = GeneratorType.AUTO)
private Long id;
//how can I annotate this ?!?!
private Map<Region, Set<Region>> regionGroup;
}
i tried to annotate with OneToMany and MapKey alone (default JoinTable) and with many variations of a customized @JoinTable, but no success ... it just doesnt work :(
P.S.
it works fine with an additional entity like below
Code:
public class RegionSet
{
@Id(generate= GeneratorType.AUTO)
private Long id;
@OneToMany(targetEntity=Region.class)
private Set<Region> regions;
}
Code:
@OneToMany(targetEntity = Region.class)
@MapKey()
private Map<RegionImpl, RegionSet> regionGroup;
many thx in advance ,
paul