I've read many threads into this forum talking about parent/child association but I didn't find any real answer about the following mapping issue :
Here is the association I want to map :
Code:
Task -- (0,n) ---> [subtask_association] <--- (1,1) Task
which means :
* a Task may have 0,n sub-tasks (but a sub-task is a Task)
* a subTask has always access to its parent Task.
Based on what I've read, this is pretty easy if the cardinality between a subTask and its parent Task is (0,1). In this case, a foreign key "parentTask" can easily be added to Task class to get a fully bidirectionnal one-to-many association.
However, in my case, I want from a subtask to be able to get the parent Task (cardinality 1,1) referenced into the entity table ....
but there's no way to specify a table name into a "many-to-one or a one-to-one" association.
Is my approach completely wrong ?
Any clue ?