Assume I have the following entities:
public class Transfer {
...
private BankAccount senderAccount;
private BankAccount receiverAccount;
...
}
And
public class BankAccount {
...
private List<Transfer> transfers;
...
}
I want the transfers list inside my BankAccount class to hold both, sent and received transfers. Will it be possible to create an annotation like:
@OneToMany(mappedBy = 'senderAccount', mappedBy = 'receiverAccount')
If not, what will be the best approach to this?
EDIT: I want both sent and received transfers to be stored in one List.
Thank you