Here is my mistake:
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)
One of the users of the system accidentally received this error, which makes no sense to me. What i know:
- Teacher table. LINKS: User table.
- Somehow, the Teacher table has a row that refers to a row in the User table, but this row does not exist in the User table.
Any idea why this is happening? Please advise!
Rephrase my Qn:
I know what the error means, however, it seems I donβt understand what caused the missing user line? I posted it all on Cascade.ALL. I do not think this is due to deletion. What are the possible scenarios that may occur above?
Edit 2:
Please refer to matching through FNH: Any problems with this?
public void Override(AutoMapping<Teacher> mapping) { mapping.References(x => x.User).Cascade.All().Not.LazyLoad(); }
Thanks!
source share