Hibernate/JPA ManyToOne vs OneToMany

后端 未结 4 604
粉色の甜心
粉色の甜心 2020-11-30 19:47

I am reading currently the documentation of Hibernate regarding the entity associations and I come accross a little difficulty to figure out some things. It has to do in ess

4条回答
  •  长情又很酷
    2020-11-30 20:10

    I will answer by an example.Suppose you have a design for an ordering or a POS system then each order has order details(products).in that case we ahave a @onetomany relationship the same case will apply for the case of a sale and sale detail relationship.If I have a user table and each user is tied to a specific shop then we can have many users tied to the same shop hence @manytoone

提交回复
热议问题