How is the “Owning Side” of this many-to-many relationship determined?

后端 未结 3 1741
天命终不由人
天命终不由人 2021-02-07 23:54

I\'m trying to get a firm grasp on the concept of Owning-side. Couldn\'t really get a clear picture from any question i found here. Basically I\'m going through the Java EE JPA

3条回答
  •  温柔的废话
    2021-02-08 00:24

    AFAIK you get to determine the owning side. There is nothing wrong in choosing any particular side in a m:n scenario.

    So, to answer your questions:

    1. How is it determined that TEAM is the owning side?

    Arbitrarily I think.

    2 . Would it make any difference if PLAYER was made the owning side instead, in this scenario?

    There will not be any difference

    3 . Would the above statement make my second question true? Meaning that there is no determining factor besides which one you decide to make the owning side, with the @JoinTable annotation?

    Yes

提交回复
热议问题