ORM 属性多重关系
我正在定义我的 cfc,想知道如何在同一列上定义多个关系?例如,在存储宠物、宠物主人及其兽医记录的数据库中: 宠物表将有一个 id,该 ID 列在所有者和兽医记录表中(是否通过链接表并不重要),宠物可以有多个所有者,所有者可以有多个宠物,宠物可以有多个兽医记录,一份兽医记录只能有一只宠物。
宠物 ID 需要链接到兽医记录 CFC 和所有者 CFC,如何在组件属性中定义它?
Im defining my cfc's and would like to know how you can define multiple relationships on the same column? For instance in a database which stores pets, their owners and their vet records:
pet table would have a id which is listed in both the owners and the vet records tables (whether via linked tables or not doesn't matter), pets can have multiple owners, owners can have multiple pets, pets can have multiple vet records, a vet record can only have one pet.
The pet id would need to link to both the vet records CFC and the Owners CFC, how do you define this in the component property?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有意识到您为每个关系添加了整个属性。我认为您将关系添加到了表示具有关系的列的属性中。
所以答案只是为每个关系添加一个新属性
I didn't realise that you add an entire property in for each relationship. I thought you added the relationship to the property representing the column with the relationship.
So the answer is simply add a new property for each relationship