Hello everyone! Help me! I have a financial system and I am in doubt in the relationship of User and Account, according to UML. From what my teacher told me, here we have to do a OneToMany in User only, but I realized that account was left with a foreign key. Could you do what this relationship would be like? When I create the test I also create Account and hedge the data and then create User and user.setConta (account).
InUserIhavebelow:
@OneToMany(cascade=CascadeType.ALL,orphanRemoval=true)
@JoinColumn(name="ID_USER", foreingkey = @ForeingKey (name="USER_CONTA_FK))
private List < Account > accounts;
And in the class Account I did not define anything, even because they told me that I do not define, but this seems to me that something is missing and in SQL database DEVELOPER, the account table is with a column of ID_USUARY ... How? I did not put anything there ... ????
Thank you and sorry for any errors.