Id = 0 is a special case in NHibernate unless you specify differently using the 'unsaved-value' attribute in the 'id' property of your entity mapping file.
What happens when you try Sessio.Load<TEntity>(1001>? John Davidson On Fri, Feb 19, 2010 at 6:46 AM, Tomasz Modelski (IDev) < [email protected]> wrote: > Hi. > > As I understand, Session.Load<TEntity>(id) should return proper entity > or throw exception if entity with such id doesn't exist. > Is it true ? > > Right now I'm debugging code when Session.Load<TEntity>( 0 ) returns > not-null and doesn't throw exception, and there is not TEntity with id > 0 in database. > Returned object is some TEntity proxy with properties throwing > exceptions when accessed. > > I'm using NHibernate v. 2.1.2.4000. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. 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.
