Hi, i have problem with OneToMany mapping.
I have tables like this:
http://www.mitrov.cz/mapping.png Is any way to map OneToMany from two entities Extendable1 and Extendable2 to same entity Extender with and all cascades.
I try bidirectional OneToMany (on extender side map extendable_id as Long extendableId). There is problem with manual assign this (not null) property. Extendable mapping like this.
Code:
@OneToMany(mappedBy="extendableId", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<Extender> extenders = new HashSet<Extender>();
Than i try unidirectional OneToMany (on extender side is extendable_id omitted) and on Extendable with
Code:
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name="EXTENDABLE_ID", nullable=false)
private Set<Extender> extenders = new HashSet<Extender>();
This not working because
https://hibernate.onjira.com/browse/HHH-5836Is there another working solution please.