Hi,
I always wondered how Hibernate or other JPA vendors determine the opposite entity of an association if it is mapped by a collection annotated just with
@OneToMany or
@ManyToMany like in the following snippet:
Code:
...
@OneToMany
public Set<Part> getParts() { return parts; }
void setParts(Set parts) { this.parts = parts; }
...
The information that parts is a
Set<Part> can not be gathered using reflection as it is lost due to the type erasure. So how do you get this information??
I'd like to develop a generic
BasicType to support Scala's generic
Option[T] as regular column type. But therefore I need to know the type of
T at runtime... But how?
Thanks in advance!
Christoph