1.I have a attachment table and the mapping as the following:
public class AttachmentMap : ClassMap<AttachmentEntity>
{
public AttachmentMap()
{
Table("T_Attachment");
LazyLoad();
Id(x => x.Id).GeneratedBy.GuidComb();
Map(x => x.Name);
Map(x => x.Size);
Map(x =>
x.BytesContent).Length(int.MaxValue).LazyLoad().Not.Update();
Map(x => x.ContentType).Length(64);
}
}
I noticed if I create a attachment entity, and use session.merge for it(I
have to use it during some scnario), it will throw out an exception, and
finally I changed nhibernate source code and fixed it. see detail in
https://nhibernate.jira.com/browse/NH-3353.
2. But another issue is when I use merge for it, the NH will load the lazy
loading properties, it is not my expected, since I want use this propertie
only for insert or reading.
The pseducode shows in below:
var projectInfo =
Mapper.Map<ProjectInfo,ProjectEntity>(session.GetByKey(....));
productInfo.Attachments.Add(new Attachment(){.....});
...
var projectEntity = Mapper.Map<ProjectEntity,ProjectInfo>(productInfo);
session.Merge(projectEntity);
session.Update(projectEntity);
Could any one help me to solve the second issue?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/iVcRGuUIeu0J.
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.