Is it possible to join 3 ICriteria together with OR statement not AND?
CODE:
ICriteria criteriaCity =
NHibernateSession.CreateCriteria(typeof(Advertisements))
.CreateCriteria(AdvertisementsProperties.City.ToString(),
"city").
Add(Restrictions.Or(
Restrictions.Like("city." +
CitiesProperties.Name.ToString(), text, MatchMode.Anywhere),
Restrictions.Like("city." +
CitiesProperties.SlovenianName.ToString(), text,
MatchMode.Anywhere)));
ICriteria criteriaArea =
NHibernateSession.CreateCriteria(typeof(Advertisements))
.CreateCriteria(AdvertisementsProperties.Area.ToString(),
"area").
Add(Restrictions.Or(
Restrictions.Like("area." +
AreasProperties.Name.ToString(), text, MatchMode.Anywhere),
Restrictions.Like("area." +
AreasProperties.SlovenianName.ToString(), text, MatchMode.Anywhere)));
ICriteria criteriaCountry =
NHibernateSession.CreateCriteria(typeof(Advertisements))
.CreateCriteria(AdvertisementsProperties.Country.ToString(),
"country").
Add(Restrictions.Or(
Restrictions.Like("country." +
CountriesProperties.Name.ToString(), text, MatchMode.Anywhere),
Restrictions.Like("country." +
CountriesProperties.SlovenianName.ToString(), text,
MatchMode.Anywhere)));
--
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.