Hi,
I wrote a class as below
Code:
public class Customer
{
private string name;
...
private Phone homePhone;
private Phone workPhone;
private Phone mobilePhone;
...
///Getters/Setters etc...
}
public class Phone{
private string code;
private string number;
private string extension;
...
}
I want to hold all the phones of the customer in Phone table. In Phone table i want to use a discriminator value like (For a customer any type of phones can be inputted)
'H' indicates home phone
'W' indicates work phone
'M' indicates mobile phone
Tables:
Code:
Customer
---------
id
name
...
Code:
Phone
--------
customerID
type
code
number
extension
Is it possible to map Customer class to both Customer and Phone tables? Or do i have to add all fields to Customer table like HOME_PHONE_EXT, HOME_PHONE_NUMBER, ..., WORK_PHONE_CODE,...?
Thanks...