I have the following structure in my db:
Order:
- OrderId
OrderPerson:
- OrderId
- PersonTypeId
PersonType:
- PersonTypeId
- Description ("Customer", "Requester", "Salesman",...)
I understand that I can add a new class/entity that inherits from OrderPerson and call that class/entity OrderCustomer, OrderRequester, OrderSalesman...
What I am struggling with is where/how to define the additional criteria:
PersonType.Description == "Customer"
I know I can do it at the query level, but I want to deifne it at the model level. I also want to eastablish the rule that an order is not recognized as an order until it has a Customer, Requester, and Salesman.
My environment is Oracle 11g, VS2010, EF4, Devart dotConnect for Oracle Professional and Devart OraDeveloper Tools.
Thanks,
Sammer
Defining a derive entity class
Try creating a Defining Query joining the OrderPerson and the PersonType entities. This new entity can be divided to three types using the Table Per Hierarchy Inheritance.
Please note that you will probably need to create a set of stored procedures for insert/update/delete operations for all these new entities.
Please note that you will probably need to create a set of stored procedures for insert/update/delete operations for all these new entities.