title: View or function 'ABC' is not updatable because the modification affects multiple base tables
body: <p>I have a view: </p>
  
  <pre><code>    CREATE VIEW [SZV].[ViewMembership]
  AS
  SELECT DISTINCT 
                           a.ID, a.RIZIVNr, a.Denomination, a.FirstInsDate, c.ID AS HcwId, e.BCEKBO AS CbeEstablishmentNr, d.ID AS TypeCodeId, d.Code AS TypeCodeCode, d.DescriptionNL, 
                           d.DescriptionFR, g.ID AS TypeSitCodeId, g.Code AS SitCode, g.DescriptionFR AS SitDescriptionFR, g.DescriptionNL AS SitDescriptionNL, f.ID AS SitCodeId, 
                           f.SitBegDate, f.SitEndDate, c.RIZIVNr AS LidRizivNr, a.LastSitID, c.LastSitID AS MemberLastSitID, n.Code AS MemberSitCode, 
                           n.DescriptionFR AS MemberSitDescriptionFR, n.DescriptionNL AS MemberSitDescriptionNL, j.FirstName1, j.FirstName2, j.LastName, j.INSS, 
                           h.FromDate AS StartDatum, k.Code AS RolCode, k.DescriptionFR AS RolDescriptionFR, k.DescriptionNL AS RolDescriptionNL, h.ToDate AS EindDatum, 
                           m.ID AS AddressId, m.Street, m.StreetNr, m.Box, m.Locality, m.ZipCode, m.INSCode, p.AttributeValueID AS AttributValueId, p.AttributeID, r.Code AS AttributeCode, 
                           q.AttributeValue, s.Code AS ProfCodeCode, s.DescriptionNL AS ProfDescriptionNL, s.DescriptionFR AS ProfDescriptionFR, h.ID AS HcwSitId, u.ID AS RequestId, 
                           u.HCWID AS RequestForId, x.RIZIVNr AS RequestedForRizivNr, u.ToDate AS RequestToDate, u.FromDate AS RequestFromDate, u.RequestedBy, 
                           v.Code AS RequestRolCode, v.DescriptionFR AS RequestRolDescriptionFR, v.DescriptionNL AS RequestRolDescriptionNL, 
                           w.FirstName1 + ' ' + w.LastName AS RequestedByName, y.FirstName1 AS RequestedForFirstName1, y.FirstName2 AS RequestedForFirstName2, 
                           y.LastName AS RequestedForLastName, y.INSS AS RequestedForINSS, z.ID AS HciAttributeRequestId, z.RequestedBy AS HciAttributeRequestedBy
  FROM            SZV.HCI AS a INNER JOIN
                           SZV.HCWHCI AS b ON a.ID = b.HCIID INNER JOIN
                           SZV.HCW AS c ON b.HCWID = c.ID INNER JOIN
                           Param.TypeCode AS d ON d.ID = a.TypeCodeID INNER JOIN
                           SZV.Org AS e ON e.ID = a.OrgID INNER JOIN
                           SZV.HCISit AS f ON f.ID IN
                               (SELECT        MAX(ID) AS Expr1
                                 FROM            SZV.HCISit
                                 WHERE        (HCIID = a.ID)) INNER JOIN
                           Param.TypeSitCode AS g ON g.ID = f.SitCodeID INNER JOIN
                           SZV.HCWHCI AS h ON h.HCIID = a.ID AND h.HCWID = c.ID INNER JOIN
                           SZV.HCWSit AS o ON o.HCWID = c.ID INNER JOIN
                           Param.TypeSitCode AS n ON n.ID = o.SitCodeID INNER JOIN
                           SZV.Person AS j ON j.ID = c.PersonID INNER JOIN
                           Param.HCWRole AS k ON h.RoleID = k.ID INNER JOIN
                           SZV.HCIAddress AS l ON l.HCIID = a.ID INNER JOIN
                           Param.ProfCode AS s ON s.ID = c.ProfCodeID INNER JOIN
                           SZV.Address AS m ON m.ID = l.AddressID LEFT OUTER JOIN
                           SZV.HCIAttribute AS p ON p.HCIID = a.ID LEFT OUTER JOIN
                           Param.AttributeValue AS q ON p.AttributeValueID = q.ID LEFT OUTER JOIN
                           Param.Attribute AS r ON r.ID = p.AttributeID AND r.Code = 'TherapeuticLink' LEFT OUTER JOIN
                           SZV.HCWHCIRequest AS u ON u.HCIID = a.ID AND u.HCWID = c.ID AND u.Validated = 0 AND u.Canceled = 0 LEFT OUTER JOIN
                           Param.HCWRole AS v ON u.RoleID = v.ID LEFT OUTER JOIN
                           SZV.Person AS w ON w.INSS = u.RequestedBy LEFT OUTER JOIN
                           SZV.HCW AS x ON u.HCWID = x.ID LEFT OUTER JOIN
                           SZV.Person AS y ON x.PersonID = y.ID LEFT OUTER JOIN
                           SZV.HCIAttributeRequest AS z ON z.HCIID = a.ID AND z.Validated = 0 AND z.Canceled = 0
  WHERE        (d.Code IN ('805', '212', '214'))
  </code></pre>
  
  <p>Now when I use NHibernate to get my result I get the following error :
  {"View or function 'SZV.ViewMembership' is not updatable because the modification affects multiple base tables."}</p>
  
  <blockquote>
    <p>{"View or function 'SZV.ViewMembership' is not updatable because the modification affects multiple base tables."}</p>
  </blockquote>
  
  <p>The code I use is the following :</p>
  
  <pre><code>ICriteria selectCriteria = this.CreateCriteria();
  var or = Restrictions.Disjunction();
  
  if (groupId != 0)
  {
      var restrHciId = Restrictions.Eq("Id", groupId);
      or.Add(restrHciId);
  }
  
  selectCriteria.Add(or);
  IList&lt;Group&gt; groupsList = this.Find(selectCriteria).ToList();
  </code></pre>
  
  <p>I am not trying to update anything in the view.
  Can anyone help me?</p>