Found the problem!! In Menu class I have some Guid properties that are defined nullable (optional) in database. I changed Guid to Guid? and the problem disappeared.
On Apr 27, 10:11 am, Luka <[email protected]> wrote: > Hi, > I have this query: > Menu menuAlias = null; > WorkUnit wAlias = null; > ProfileWorkUnit profileWUAlias = null; > UserProfile upAlias = null; > User userAlias = null; > Tenant tenantAlias = null; > Menu parentMenuAlias = null; > Resource resourceAlias = null; > LocaleResource locResAlias = null; > Locale localeAlias = null; > Profile profileAlias = null; > Feature featureAlias = null; > > var query = QueryOver.Of(() => menuAlias) > .JoinQueryOver(() => menuAlias.Resource, () => > resourceAlias) > .JoinQueryOver(() => resourceAlias.LocaleResources, () > => locResAlias) > .JoinQueryOver(() => locResAlias.Locale, () => > localeAlias) > .JoinQueryOver(() => menuAlias.ParentMenuItem, () => > parentMenuAlias, JoinType.LeftOuterJoin) > .JoinQueryOver(() => menuAlias.Feature, () => > featureAlias, JoinType.LeftOuterJoin) > .JoinQueryOver(() => menuAlias.WorkUnit, () => wAlias, > JoinType.LeftOuterJoin) > .JoinQueryOver(() => wAlias.ProfileWorkUnits, () => > profileWUAlias, JoinType.LeftOuterJoin) > .JoinQueryOver(() => profileWUAlias.Profile, () => > profileAlias, JoinType.LeftOuterJoin) > .JoinQueryOver(() => profileAlias.UserProfiles, () => > upAlias, JoinType.LeftOuterJoin) > .JoinQueryOver(() => upAlias.User, () => userAlias, > JoinType.LeftOuterJoin) > .JoinQueryOver(() => profileAlias.Tenant, () => > tenantAlias, JoinType.LeftOuterJoin) > .JoinQueryOver(() => menuAlias.Application) > .Where(a => a.Alias == parameters.ApplicationAlias) > .Where(() => userAlias.Id == parameters.UserId || > tenantAlias.Id == parameters.TenantId) > .Where(() => localeAlias.Id == parameters.LocaleId); > > var result = SessionHelper.Transact(() => > query.GetExecutableQueryOver(Session).List<Menu>()); > When it executes, I see a Select statement and after that, some update > statement on Menu entity. > Why is this happening? > Please help? > I use Mapping by convention from NHibernate 3.2 -- 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.
