Class SessionSearchRestriction
java.lang.Object
de.hybris.platform.search.restriction.session.SessionSearchRestriction
SessionSearchRestriction is the object for defining dynamic search restrictions. Example:
// We want to limit Language to active
final ComposedTypeModel restrictedType = typeService.getComposedTypeForClass(LanguageModel.class);
try
{
final SessionSearchRestriction restriction = new SessionSearchRestriction("someUniqueCode", "{active} IS TRUE", restrictedType);
final Collection<SessionSearchRestriction> restrictions = new ArrayList<SessionSearchRestriction>();
restrictions.add(restriction);
searchRestrictionService.addSessionSearchRestrictions(restrictions);
// ... business code goes here now ...
}
finally
{
// clear all dynamic restrictions
searchRestrictionService.clearSessionSearchRestrictions();
}
-
Constructor Summary
ConstructorsConstructorDescriptionSessionSearchRestriction(String code, String query, ComposedTypeModel restrictedType) -
Method Summary
-
Constructor Details
-
SessionSearchRestriction
-
-
Method Details