Class SessionSearchRestriction
- java.lang.Object
-
- de.hybris.platform.search.restriction.session.SessionSearchRestriction
-
public class SessionSearchRestriction extends java.lang.Object
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
Constructors Constructor Description SessionSearchRestriction(java.lang.String code, java.lang.String query, ComposedTypeModel restrictedType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object another)
Session search restriction are considered equal if their codes and types match.java.lang.String
getCode()
java.lang.String
getQuery()
ComposedTypeModel
getRestrictedType()
int
hashCode()
Object equality is based on code and type.
-
-
-
Constructor Detail
-
SessionSearchRestriction
public SessionSearchRestriction(java.lang.String code, java.lang.String query, ComposedTypeModel restrictedType)
-
-
Method Detail
-
getCode
public java.lang.String getCode()
-
getQuery
public java.lang.String getQuery()
-
getRestrictedType
public ComposedTypeModel getRestrictedType()
-
equals
public boolean equals(java.lang.Object another)
Session search restriction are considered equal if their codes and types match.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Object equality is based on code and type.- Overrides:
hashCode
in classjava.lang.Object
- See Also:
equals(Object)
-
-