public abstract class AbstractParamParser extends Object implements ParamParser
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
protected static String |
REGEX_COLON_MARK |
protected static String |
REGEX_DOLLAR_MARK |
protected static String |
REGEX_HASH_MARK |
protected static String |
REGEX_IN |
protected static String |
REGEX_QUESTION_MARK |
protected static String |
REGEX_SINGLE_QUOTE |
Constructor and Description |
---|
AbstractParamParser() |
Modifier and Type | Method and Description |
---|---|
protected Object[] |
getParamsClauseIN(Object params,
String name) |
String |
getPlaceholder()
Specifies a character that will be replaced to in SQL query.
|
protected String |
padspace(int size,
int index) |
String |
replaceForPlaceholder(String query)
Replace the parameters names for question marks
|
String |
replaceForPlaceholder(String query,
Object params)
Replace the parameters names for question marks
|
String |
replaceForPlaceholderWithNumber(String query,
Object params) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
find, getType
protected final org.slf4j.Logger log
protected static final String REGEX_SINGLE_QUOTE
protected static final String REGEX_IN
protected static final String REGEX_HASH_MARK
protected static final String REGEX_COLON_MARK
protected static final String REGEX_DOLLAR_MARK
protected static final String REGEX_QUESTION_MARK
public AbstractParamParser()
public String replaceForPlaceholder(String query)
ParamParser
replaceForPlaceholder
in interface ParamParser
query
- the SQL sentencepublic String replaceForPlaceholderWithNumber(String query, Object params)
replaceForPlaceholderWithNumber
in interface ParamParser
public String replaceForPlaceholder(String query, Object params)
ParamParser
replaceForPlaceholder
in interface ParamParser
query
- the SQL sentenceparams
- parameters used at query, its necessary when the query use IN clausepublic String getPlaceholder()
ParamParser
?
getPlaceholder
in interface ParamParser
protected Object[] getParamsClauseIN(Object params, String name)
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.