public class FilterDefinitionFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<FilterDefinition>, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
Typically defined as an inner bean within a LocalSessionFactoryBean definition, as the list element for the "filterDefinitions" bean property. For example:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> ... <property name="filterDefinitions"> <list> <bean class="org.springframework.orm.hibernate3.FilterDefinitionFactoryBean"> <property name="filterName" value="myFilter"/> <property name="parameterTypes"> <map> <entry key="myParam" value="string"/> <entry key="myOtherParam" value="long"/> </map> </property> </bean> </list> </property> ... </bean>Alternatively, specify a bean id (or name) attribute for the inner bean, instead of the "filterName" property.
FilterDefinition
,
LocalSessionFactoryBean.setFilterDefinitions(org.hibernate.engine.FilterDefinition...)
Constructor and Description |
---|
FilterDefinitionFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
FilterDefinition |
getObject() |
Class<FilterDefinition> |
getObjectType() |
boolean |
isSingleton() |
void |
setBeanName(String name)
If no explicit filter name has been specified, the bean name of
the FilterDefinitionFactoryBean will be used.
|
void |
setDefaultFilterCondition(String defaultFilterCondition)
Specify a default filter condition for the filter, if any.
|
void |
setFilterName(String filterName)
Set the name of the filter.
|
void |
setParameterTypes(Map<String,String> parameterTypes)
Set the parameter types for the filter,
with parameter names as keys and type names as values.
|
public void setFilterName(String filterName)
public void setParameterTypes(Map<String,String> parameterTypes)
org.hibernate.type.TypeResolver#heuristicType(String)
.public void setDefaultFilterCondition(String defaultFilterCondition)
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
setFilterName(java.lang.String)
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public FilterDefinition getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<FilterDefinition>
public Class<FilterDefinition> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<FilterDefinition>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<FilterDefinition>