can someone please explain me @MapsId in hibernate?

后端 未结 5 1652
天涯浪人
天涯浪人 2020-11-29 03:34

Can someone please explain to me @MapsId in hibernate? I\'m having a hard time understanding it.

It would be great if one could explain it with an examp

5条回答
  •  清酒与你
    2020-11-29 03:44

    As he explained Vladimir in his tutorial, The best way to map a @OneToOne relationship is to use @MapsId. This way, you don’t even need a bidirectional association since you can always fetch the Child entity by using the Parent entity identifier.

提交回复
热议问题