Hi,
I'm using Hibernate annotations and I'm trying to make en embedded generic class persistent
@Embeddable
class Manager<T extends PersistentObject> {
@OneToMany(cascade = CascadeType.All, targetEntity=PersistentObject.class)
List<T> objects = new ArrayList<T>();
//Getter und Setter
....
}
Another class uses this Manager class for different persistentObject subclasses
@Entity
class Person extends PersistentObject {
@Embedded
Manager<PhoneNumber> phoneNumberManager = new Manager<PhoneNumber>();
@Embedded
Manager<Address> addressManager = new Manager<Address>();
//Getter und Setter
......
}
@Entity
class Address extends PersistentObject {
....
}
@Entity
class Phonenumber extends PersistentObject {
...
}
Everything works without an error, but the problem is that I have just one
JoinTable called person_persistentobject.
Is it possible to get a different JoinTables for every Generic like person_address, person_phonenumber.....?
Thanks for help!
|