Here we go... I have a table (which unfortunatelly I can't change) with columns like: date, startTime, endTime. And I have data classes with two fields: startDateTime = date + startTime endDateTime = date + endTime
Map(x => x.EndDateTime)
.Columns.Clear()
.Columns.Add("date", "endTime")
.CustomType<MyCustomType>();
Map(x => x.StartDateTime)
.Columns.Clear()
.Columns.Add("date", "startTime")
.CustomType<MyCustomType>();
MyCustomType is a class implementing IUserType interface. This seemed to work, but it works only with reading data from database. While saving or updating NHibernate puts column "date" twice, and query can not be commited.
My question is: is any way to go around this? I want both fields to be not-read-only. (setting one of them as read-only helps, but it's not a solution which satisfies me).