Package org.apache.ibatis.reflection
Class ParamNameResolver
- java.lang.Object
-
- org.apache.ibatis.reflection.ParamNameResolver
-
public class ParamNameResolver extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
GENERIC_NAME_PREFIX
-
Constructor Summary
Constructors Constructor Description ParamNameResolver(Configuration config, Method method)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getNamedParams(Object[] args)
A single non-special parameter is returned without a name.String[]
getNames()
Returns parameter names referenced by SQL providers.static Object
wrapToMapIfCollection(Object object, String actualParamName)
Wrap to aMapperMethod.ParamMap
if object isCollection
or array.
-
-
-
Field Detail
-
GENERIC_NAME_PREFIX
public static final String GENERIC_NAME_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParamNameResolver
public ParamNameResolver(Configuration config, Method method)
-
-
Method Detail
-
getNames
public String[] getNames()
Returns parameter names referenced by SQL providers.- Returns:
- the names
-
getNamedParams
public Object getNamedParams(Object[] args)
A single non-special parameter is returned without a name. Multiple parameters are named using the naming rule. In addition to the default names, this method also adds the generic names (param1, param2, ...).
- Parameters:
args
- the args- Returns:
- the named params
-
wrapToMapIfCollection
public static Object wrapToMapIfCollection(Object object, String actualParamName)
Wrap to aMapperMethod.ParamMap
if object isCollection
or array.- Parameters:
object
- a parameter objectactualParamName
- an actual parameter name (If specify a name, set an object toMapperMethod.ParamMap
with specified name)- Returns:
- a
MapperMethod.ParamMap
- Since:
- 3.5.5
-
-