For joined inheritance, such as:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "task_base")
public class TaskBase { ... }
@Entity
@Table(name = "task")
public class Task extends TaskBase { ... }
Does JPA allow mapping a one-to-many association with the foreign key
column
On Sat, 2016-02-13 at 13:56 -0800, Gail Badner wrote:
> JPA 2.1 spec says this for the description of @JoinColumn( name="..."
> )
> when used for a unidirectional one-to-many association:
>
> "If the join is for a unidirectional OneToMany mapping using a
> foreign key
> mapping strategy, the forei
There is a case about association shared in a inheritance case that I don't
fully recollect. I was against supporting as it did break OO when you thought
about it - at least when I thought about it.
But this case seems to be different. Does someone explicitly asks for that use
case ?
> On 13
Someone has been doing the following so that multiple associations with
entities within a joined inheritance hierarchy share the same foreign key:
1) each association that shares the same foreign key uses @OneToMany(
targetEntity= ) so that the FK is in the superclass;
2) each association uses a f