Note that there are some explanatory texts on larger screens.

plurals
  1. PONothing happens on SaveOrUpdate using FluentNHibernate
    primarykey
    data
    text
    <p>Nothing happens when updating an entity using the SaveOrUpdate method with FluentNHibernate. Flush does work but I want to use SaveOrUpdate due to existing repository infrastructure. What could be the problem?</p> <p>Configuration:</p> <pre><code>sessionFactory = Fluently.Configure() .Database(MsSqlConfiguration .MsSql2005 .ConnectionString(c =&gt; c.FromConnectionStringWithKey("repository"))) .Mappings(m =&gt; m.FluentMappings .AddFromAssemblyOf&lt;InvoiceMap&gt;()) .BuildSessionFactory(); </code></pre> <p>Mappings:</p> <pre><code>public InvoiceMap() { Id(x =&gt; x.InvoiceID, "InvoiceID"); Map(x =&gt; x.InvoiceNumber); Map(x =&gt; x.InvoiceDate); Map(x =&gt; x.Company).CustomTypeIs&lt;CompanyType&gt;(); Map(x =&gt; x.TransactionNumber).CustomTypeIs&lt;TransactionNumberType&gt;(); Map(x =&gt; x.LongAddressBookNumber); Map(x =&gt; x.PurchaseOrderNumber); Map(x =&gt; x.ReceivedDateTime); Map(x =&gt; x.OCR); Map(x =&gt; x.DocumentNumber); Map(x =&gt; x.DocumentType); Map(x =&gt; x.PaymentStatus).CustomTypeIs&lt;PaymentStatusType&gt;(); HasMany(x =&gt; x.Attestations) .KeyColumnNames.Add("InvoiceID") .Inverse() .Cascade.AllDeleteOrphan() .AsBag(); HasMany(x =&gt; x.AttestationRequests) .KeyColumnNames.Add("InvoiceID") .Inverse() .Cascade.AllDeleteOrphan() .AsBag(); HasMany(x =&gt; x.States) .KeyColumnNames.Add("InvoiceID") .Inverse() .Cascade.AllDeleteOrphan() .AsBag(); } public AttestationMap() { Id(x =&gt; x.ID, "AttestationID"); Map(x =&gt; x.ReceivedAt); Map(x =&gt; x.IsInvalid, "Invalid"); Map(x =&gt; x.InvalidationReason); Map(x =&gt; x.FileName); Map(x =&gt; x.FileData); References&lt;EmployeeSnapshot&gt;(x =&gt; x.Certifier, "Certifier") .Cascade.All() .FetchType.Join(); References&lt;Invoice&gt;(x =&gt; x.Owner, "InvoiceID"); } public AttestationReminderMap() { Id(x =&gt; x.ID, "AttestationReminderID"); Map(x =&gt; x.CC) .CustomTypeIs&lt;RecipientType&gt;(); Map(x =&gt; x.Message); Map(x =&gt; x.SentAt); References&lt;AttestationRequest&gt;(x =&gt; x.Owner, "RequestID"); } </code></pre> <p>Any ideas?</p> <p>Thanks, Kristoffer</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload