title: NHibernate.ObjectNotFoundException: No row with the given identifier exists
body: <p>Here's my error:</p>
  
  <pre><code>NHibernate.ObjectNotFoundException: No row with the given identifier exists[Project.Core.Entities.User#(GUID)]
  at Hibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id) 
  at NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)
  </code></pre>
  
  <p>One of the users of the system chanced upon getting this error, which doesn't make sense to me entirely. What I do know:</p>
  
  <ol>
  <li>A Teacher table REFERENCES a User table.</li>
  <li>Somehow the Teacher table has a row that references to a row in the User's table, but that row doesn't exist in the User's table.</li>
  </ol>
  
  <p>Any idea why is this happening? Please advise!</p>
  
  <p>Rephrase my Qn:</p>
  
  <p>I know what does the error meant, however I don't seem to figure out what caused the missing user row? I have placed it all on Cascade.ALL. I don't think it's related to deletion. What are the possible scenarios the above may happen?</p>
  
  <p>Edit 2:</p>
  
  <p>Please refer to the mapping via FNH: Any issues with this?</p>
  
  <pre><code>public void Override(AutoMapping&lt;Teacher&gt; mapping)
      {
          mapping.References(x =&gt; x.User).Cascade.All().Not.LazyLoad();
      }
  </code></pre>
  
  <p>Thanks!</p>