使用查找表进行映射 [英] Mapping with a Lookup Table

查看:69
本文介绍了使用查找表进行映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:


我已经看到了一些建模表每个层次结构继承的例子:


联系表


- 名称


- ContactType


字段ContactType包含字符串" Customer"和"员工"。这些示例建议创建2个继承自Contact的类,并添加一个条件,当ContactType =" Customer"然后该课程是客户,当
时,ContactType =  "员工"然后是员工类。接下来的步骤是创建Contact Class Abstract,然后从Contact Table中删除ContactType字段。


问题:


这样可行如果ContactType字段与任何内容无关。我的问题是我的ContactType字段与ContactType表有关。当我在我的桌子上使用上述步骤时,然后 从联系表中删除ContactType字段,编译器
抱怨ContactType和Contact之间的关联没有被corectly映射。当我打开关联时,ContactType.ContactType字段被映射,但是当我在下拉列表中选择将其映射到联系表中的字段时,ContactType字段
显然是丢失的,因为我删除了它。


你如何使这项工作?


谢谢


-Eric


 


 

解决方案

我们不支持映射框。您必须使用查询/定义查询查询和存储过程/函数进行更新/删除/插入操作。


谢谢


Srikanth


Problem:

I have seen a number of examples for modeling Table per Hierarchy inheritance:

Contact Table

- Name

- ContactType

The field ContactType contains strings "Customer" and "Employee". The examples suggest creating 2 classes that inherit from Contact and add a condition that when ContactType = "Customer" then the class is a customer and when ContactType =  "Employee" then an Employee class. The next step is to then make the Contact Class Abstract, and then delete the ContactType field from the Contact Table.

Problem:

This works ok if the ContactType field isn't related to anything. My problem is my ContactType field is related to a ContactType Table. When I use the above steps with my table, and then  delete the ContactType field from the contact table the compiler complains that association between ContactType and Contact isn't mapped corectly. When I open the association the ContactType.ContactType field is mapped, but when I select in the dropdown to map it with the field in the Contact Table, the ContactType field is obviously missing, because I deleted it.

How do you make this work?

Thanks

-Eric

 

 

解决方案

We don't support the mapping out of the box. You would have to use views/defining query for queries and stored procs/ functions for update/delete/insert operations.

Thanks

Srikanth


这篇关于使用查找表进行映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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