Package net.sf.jkniv.sqlegance.params
Interface ParamParser
-
- All Known Implementing Classes:
AbstractParamParser,ParamParserColonMark,ParamParserDollarMark,ParamParserHashMark,ParamParserNoMark,ParamParserQuestionMark
public interface ParamParserStrategy to parser the parameters from query extracting yours names or replacing the names for question mark'?', used at JDBC prepared statements. Instances of this class must be IMMUTABLE and safe for use by multiple concurrent threads- Since:
- 0.6.0
- Author:
- Alisson Gomes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String[]find(String query)extract the parameters names from query.StringgetPlaceholder()Specifies a character that will be replaced to in SQL query.ParamMarkTypegetType()StringreplaceForPlaceholder(String query)Replace the parameters names for question marksStringreplaceForPlaceholder(String query, Object params)Replace the parameters names for question marksStringreplaceForPlaceholderWithNumber(String query, Object params)
-
-
-
Method Detail
-
find
String[] find(String query)
extract the parameters names from query.- Parameters:
query- the SQL sentence- Returns:
- array parameters from query
-
replaceForPlaceholder
String replaceForPlaceholder(String query, Object params)
Replace the parameters names for question marks- Parameters:
query- the SQL sentenceparams- parameters used at query, its necessary when the query use IN clause- Returns:
- the new SQL sentence with question marks.
-
replaceForPlaceholder
String replaceForPlaceholder(String query)
Replace the parameters names for question marks- Parameters:
query- the SQL sentence- Returns:
- the new SQL sentence with question marks.
-
replaceForPlaceholderWithNumber
String replaceForPlaceholderWithNumber(String query, Object params)
-
getType
ParamMarkType getType()
-
getPlaceholder
String getPlaceholder()
Specifies a character that will be replaced to in SQL query. Default is?- Returns:
- the place holder from parser
-
-