We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问楼主,User和Article,一对多的关系,为什么只在多端(Artcile表)里面使用@ManyToOne设置user_id外键关联user表,没有在一端(User表)里面设置@OnToMany List<Article> article 这个呢,求解答,谢谢
请问楼主,User和Article,一对多的关系,为什么只在多端(Artcile表)里面使用@ManyToOne设置user_id外键关联user表,没有在一端(User表)里面设置
List<Article> article
The text was updated successfully, but these errors were encountered:
@Lynne0 一对多的时候,一般由多的一方维护关系,也就是Article,保存Article时会先Set上User,来维护关系,并且取Artcile的时候,通常需要展示相应的User;没在User设置@OnToMany是因为除了不需要User来维护关系外,User也几乎不需要级联查询Artcile,获取User的时候一般只是需要自身的基础信息,你也可以加上,可以但没必要。
Sorry, something went wrong.
No branches or pull requests
请问楼主,User和Article,一对多的关系,为什么只在多端(Artcile表)里面使用@ManyToOne设置user_id外键关联user表,没有在一端(User表)里面设置
@OnToManyList<Article> article
这个呢,求解答,谢谢The text was updated successfully, but these errors were encountered: