FilterKeypublic final class FilterKey extends Object implements SerializableAllows cached queries to be keyed by enabled filters. |
Fields Summary |
---|
private String | filterName | private Map | filterParameters |
Constructors Summary |
---|
public FilterKey(String name, Map params, Map types, org.hibernate.EntityMode entityMode)
filterName = name;
Iterator iter = params.entrySet().iterator();
while ( iter.hasNext() ) {
Map.Entry me = (Map.Entry) iter.next();
Type type = (Type) types.get( me.getKey() );
filterParameters.put( me.getKey(), new TypedValue( type, me.getValue(), entityMode ) );
}
|
Methods Summary |
---|
public static java.util.Set | createFilterKeys(java.util.Map enabledFilters, org.hibernate.EntityMode entityMode)
if ( enabledFilters.size()==0 ) return null;
Set result = new HashSet();
Iterator iter = enabledFilters.values().iterator();
while ( iter.hasNext() ) {
FilterImpl filter = (FilterImpl) iter.next();
FilterKey key = new FilterKey(
filter.getName(),
filter.getParameters(),
filter.getFilterDefinition().getParameterTypes(),
entityMode
);
result.add(key);
}
return result;
| public boolean | equals(java.lang.Object other)
if ( !(other instanceof FilterKey) ) return false;
FilterKey that = (FilterKey) other;
if ( !that.filterName.equals(filterName) ) return false;
if ( !that.filterParameters.equals(filterParameters) ) return false;
return true;
| public int | hashCode()
int result = 13;
result = 37 * result + filterName.hashCode();
result = 37 * result + filterParameters.hashCode();
return result;
| public java.lang.String | toString()
return "FilterKey[" + filterName + filterParameters + ']";
|
|