Fetch base class data.

Posts   
 
    
fatihtat
User
Posts: 15
Joined: 23-Feb-2010
# Posted on: 25-Mar-2010 09:38:57   

Hi,

I have a problem, again. I have two class. One is person. The other one is personparameter. The personparameter table derived from person.

Table Structure like that;

Person

ID (PK) Name (not null) UserName (not null) Password (not null)

PersonParameter

PersonID(PK) Key Value

I want to insert a new personparameter

personID = 4, Key = test Value = 123

PersonParameterEntity entity = new PersonParameterEntity(personID);

entity.Key = Key; entity.Value = Value;

entity.Save(); //this part throw an exception you cannot insert null on "person"."name".

In this situation, i know worng that the derived ctor fetch the base class data too. I need to base class data to save the derived class.

How can I do?

fatihtat
User
Posts: 15
Joined: 23-Feb-2010
# Posted on: 25-Mar-2010 09:44:45   

I try this but does not working rage

PersonparameterEntity entity = PersonparameterEntity.FetchPolymorphic(null, 4,null);

fatihtat
User
Posts: 15
Joined: 23-Feb-2010
# Posted on: 25-Mar-2010 10:14:44   

i solve the problem. I think this is simple solvable problem.

in my person table there is a rescord. But the personparameter table is empty. So the code cannot fetch the base (person) data.

Thanks a lot. Have a nice work...