This article is a mirror article of machine translation, please click here to jump to the original article.

View: 22310|Reply: 0

[Source] What do many-to-many, one-to-many, and many-to-one mean in nhibernate?

[Copy link]
Posted on 8/2/2016 3:59:15 PM | | |

Many-to-many For example, a user can have multiple roles, and a role can be used against multiple different users
Therefore, the relationship between the role and the user is a many-to-many relationship, and the third table is generally used to show the corresponding relationship between the two
One-to-many For example, a teacher can correspond to many students
many-to-one is the opposite of many-to-one  
one-to-one For example, citizens and ID cards correspond to each other

1-to-many example in hibernate (teacher-student)
Configuration files
# Teacher.hbm.xml
   
  




Previous:asp.net The MVC controller returns a 404 or 502 state
Next:c# ForEach
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com