I have this query:
Code:
IQuery query = session.CreateQuery("from BlogEntity b where b.Host = :host and b.Path = :path");
query.SetParameter("host", host);
query.SetParameter("path", path);
return query.UniqueResult<BlogEntity>();
That works fine, just as intended, but the SQL log show 2 select statements as does SQL Profilier.
Code:
NHibernate: select blogentity0_.Id as Id0_, blogentity0_.Name as Name0_, blogentity0_.Host as Host0_, blogentity0_.Path as Path0_, blogentity0_.Skin as Skin0_ from Blog blogentity0_ where (blogentity0_.Host=@p0 )and(blogentity0_.Path=@p1 ); @p0 = 'LocalHost', @p1 = 'Path1'
NHibernate: select blogentity0_.Id as Id0_, blogentity0_.Name as Name0_, blogentity0_.Host as Host0_, blogentity0_.Path as Path0_, blogentity0_.Skin as Skin0_ from Blog blogentity0_ where (blogentity0_.Host=@p0 )and(blogentity0_.Path=@p1 ); @p0 = 'LocalHost', @p1 = 'Path1'
Why are two selects being executed?