public class ParamNameResolver extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
GENERIC_NAME_PREFIX |
| Constructor and Description |
|---|
ParamNameResolver(Configuration config,
Method method) |
| Modifier and Type | Method and 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 a
MapperMethod.ParamMap if object is Collection or array. |
public static final String GENERIC_NAME_PREFIX
public ParamNameResolver(Configuration config, Method method)
public String[] getNames()
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, ...).
args - the argspublic static Object wrapToMapIfCollection(Object object, String actualParamName)
MapperMethod.ParamMap if object is Collection or array.object - a parameter objectactualParamName - an actual parameter name
(If specify a name, set an object to MapperMethod.ParamMap with specified name)MapperMethod.ParamMapCopyright © 2009–2021 MyBatis.org. All rights reserved.