多对多关系和关系模型 [英] many-to-many relation and relational model

查看:504
本文介绍了多对多关系和关系模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习Merise或UML,如果我们有多对多关系的表,我们必须在关系模型(在Mysql中)中创建一个新表,并且此表将包含另外两个表的两个表。
但是我们真的必须创建一个新的,因为使用hibernate和映射我认为我们不需要。

因为每个表(实体)都会有另一个表的列表(实体)。
那么处理多对多关系的正确方法是什么?创建一个新表或不是?

解决方案

通常您需要不选择)。然而,Spring不是其中之一,它只是简化了手动规范化过程


I learn in Merise or UML if we have tow tables with many-to-many relation we have to create a new table in relational model (in Mysql) and this table will contain the tow id of the tow other tables.
But we really must create a new one because with hibernate and mapping i think we don't need to.
Because each table(entity) will have a list of the other table(entity).
So what's the right way to deal with many-to-many relation ? create a new table or not ?

解决方案

Typically you will need to normalise a many to many relationship in a Database, (There are some edge cases where an expert might choose not to). However Spring is not one of these, it just simplifies part of the manual normalisation process.

这篇关于多对多关系和关系模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆