private void CriteriaAddOrganizationTreeRootParentIdCriterion(ICriteria criteria) { IList <object> rootParentIdValues = new object[] { "" }; if (rootParentIdValues.Count == 1) { NHibernateUtils.CriteriaAddCriterion(criteria, "Id.ParentId", rootParentIdValues[0]); } else { var j = Restrictions.Disjunction(); foreach (var pIdValue in rootParentIdValues) { NHibernateUtils.DisjunctionAddCriterion(j, "Id.ParentId", pIdValue); } criteria.Add(j); } }