@Jointable or @Joincolumn

Asked

Viewed 87 times

0

Good afternoon, you guys I have a diagram as below and I have a question. It is between User and Account and what I am in doubt is, if I access by ACCOUNT, I find the USER, but I can not do the reverse. My question is, is it correct to do so? How do I user not know my account? only account knows who I am... inserir a descrição da imagem aqui You could do a @Jointable and make a third table where both sides would have access. Help me the best way. Thank you very much!

  • User may have many accounts.

1 answer

1


The user can have n accounts. If you want the account to have access to the user and vice versa, you can use bidirectional association.

  • This diagram was my teacher who passed and at first I found strange. In case, if it is bidirectional, I will be modifying the diagram.

  • So, another solution would be to create another table. But, in the same way, the diagram :D would be modified. For me, it makes sense for the user to have n accounts.

  • I’m having trouble salvaging the launch, you can help me?

  • Launch has ACCOUNT, CATEGORY, USER, but when adding Itemlancamento I’m in trouble because it gives message from Nullpointerexception. I have to create ITEM and at the same time create release... ??????????????????

  • Create another question and post the code so that it is possible to identify the reason for the exception. Remember how you solved this question, in case you solved the diagram thing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.