Hi List,
i have big problems with SaveOrUpdate();
Insertin new values aork as expected.
But, Updateing a value didn't work
My Mappings:
public class EmployeeMapping : BaseClassMap<Employee>
{
public EmployeeMapping()
{
References(x => x.Person).Not.Nullable().Not.LazyLoad
().Cascade.SaveUpdate();
......
}
public PersonMapping()
{
References(x => x.Adress).Not.Nullable().Cascade.SaveUpdate
().Not.LazyLoad();
------
}
public AdressMapping()
{
Map(x => x.AdressLine1);
----
}
All Identities are GUID's
As i said, Insert work.
All SQL Statemenst fir insert are generated:
My TestCode:
[Test]
public void CanChangeAdress ()
{
List<EmployeeDto> initialList = employeeService.GetList();
EmployeeDto e1 = employeeService.Get(initialList[0].Id);
e1.HoursPerWeek = 40;
SQL generated
e1.PersonDto.Firstname = "testvalue"; NO SQL
generated
e1.PersonDto.AdressDto.AdressLine1 = "teststreet"; NO SQL
generated
employeeService.MakePersistant(e1);
this means, when i Update an Employee, only Properties belonging
directly to Employee are updated. The referenced classes like Person
and Adress aren't touched by Update
Any idea,
Thanks in advance
Peter
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.