How do you map a composite id to a composite user type with Fluent NHibernate?
- by gabe
i'm working w/ a legacy database is set-up stupidly with an index composed of a char id column and two char columns which make up a date and time, respectively. I have created a icompositeusertype for the date and time columns to map to a single .NET DateTime property on my entity, which works by itself when not part of the id. i need to somehow use a composite id with key property mapping that includes my icompositeusertype for mapping to the two char date and time columns. Apparently w/ my version of Fluent NHibernate, CompositeIdentityPart doesn't have a CustomTypeIs() method, so i can't just do the following in my override:
mapping.UseCompositeId()
.WithKeyProperty(x => x.Id, CommonDatabaseFieldNames.Id)
.WithKeyProperty(x => x.FileCreationDateTime)
.CustomTypeIs<FileCreationDateTimeType>();
is something like this even possible w/ NHibernate let alone Fluent? I haven't been able to find anything on this.