org.hibernate.param

Class DynamicFilterParameterSpecification

Implemented Interfaces:
ParameterSpecification

public class DynamicFilterParameterSpecification
extends java.lang.Object
implements ParameterSpecification

A specialized ParameterSpecification impl for dealing with a dynamic filter parameters.

Note: this class is currently not used. The ideal way to deal with dynamic filter parameters for HQL would be to track them just as we do with other parameters in the translator. However, the problem with that is that we currently do not know the filters which actually apply to the query; we know the active/enabled ones, but not the ones that actually "make it into" the resulting query.

Author:
Steve Ebersole

Constructor Summary

DynamicFilterParameterSpecification(String filterName, String parameterName, Type definedParameterType, int queryParameterPosition)

Method Summary

int
bind(PreparedStatement statement, QueryParameters qp, SessionImplementor session, int position)
Bind the appropriate value into the given statement at the specified position.
Type
getExpectedType()
Get the type which we are expeting for a bind into this parameter based on translated contextual information.
String
renderDisplayInfo()
Render this parameter into displayable info (for logging, etc).
void
setExpectedType(Type expectedType)
Injects the expected type.

Constructor Details

DynamicFilterParameterSpecification

public DynamicFilterParameterSpecification(String filterName,
                                           String parameterName,
                                           Type definedParameterType,
                                           int queryParameterPosition)

Method Details

bind

public int bind(PreparedStatement statement,
                QueryParameters qp,
                SessionImplementor session,
                int position)
            throws SQLException
Bind the appropriate value into the given statement at the specified position.
Specified by:
bind in interface ParameterSpecification
Parameters:
statement - The statement into which the value should be bound.
qp - The defined values for the current query execution.
session - The session against which the current execution is occuring.
position - The position from which to start binding value(s).
Returns:
The number of sql bind positions "eaten" by this bind operation.

getExpectedType

public Type getExpectedType()
Get the type which we are expeting for a bind into this parameter based on translated contextual information.
Specified by:
getExpectedType in interface ParameterSpecification
Returns:
The expected type.

renderDisplayInfo

public String renderDisplayInfo()
Render this parameter into displayable info (for logging, etc).
Specified by:
renderDisplayInfo in interface ParameterSpecification
Returns:
The displayable info.

setExpectedType

public void setExpectedType(Type expectedType)
Injects the expected type. Called during translation.
Specified by:
setExpectedType in interface ParameterSpecification
Parameters:
expectedType - The type to expect.