Hello, I am having a problem using JPA with Generics. I have a class similar to the following:
Code:
@MappedSubclass
public abstract class Person<A extends AddressEntry> {
@OneToMany(mappedBy = "person")
@MapKey(name = "zip")
public Map<ZipCode, A> getAddressMap() { return addressMap; }
public void setAddressMap(Map<ZipCode, A> map) { addressMap = map; }
private Map<ZipCode, A> addressMap;
}
I get the following exception:
org.hibernate.AnnotationException: Property Person.addressMap has an unbound type and no explicit target entity. Resolve this Generic usage issue or set an explicit target attribute (eg @OneToMany(target=) or use an explicit @Type
Note: I am using hibernate 3.5.2 and hibernate JPA v 2.0.0-1.0.0