public class SqlWrapper extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
SqlWrapper(CommandType type)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static SqlWrapper |
delete(String sql,
Map<String,Integer> namesToIndexes,
int expectedCount)
Set delete.
|
int |
getExpectedCount()
get the expected count.
|
Map<String,Integer> |
getNamesToIndexes()
A column name to index in SQL mapping.
|
String |
getSql()
Get the SQL result.
|
CommandType |
getType()
Get command type.
|
static SqlWrapper |
insert(String sql,
Map<String,Integer> namesToIndexes,
int expectedCount)
Set insert.
|
static SqlWrapper |
newWrapper(CommandType type,
String sql,
Map<String,Integer> namesToIndexes,
int expectedCount)
Get a new wrapper.
|
protected static SqlWrapper |
prepare(SqlWrapper type,
String sql,
Map<String,Integer> namesToIndexes,
int expectedCount)
Prepare any instance.
|
static SqlWrapper |
update(String sql,
Map<String,Integer> namesToIndexes,
int expectedCount)
Set update.
|
protected SqlWrapper(CommandType type)
type - The command type.public CommandType getType()
public String getSql()
public Map<String,Integer> getNamesToIndexes()
public int getExpectedCount()
public static SqlWrapper insert(String sql, Map<String,Integer> namesToIndexes, int expectedCount)
sql - The command.namesToIndexes - A mapping from column name to placeholder index.expectedCount - The expected count result.public static SqlWrapper update(String sql, Map<String,Integer> namesToIndexes, int expectedCount)
sql - The command.namesToIndexes - A mapping from column name to placeholder index.expectedCount - The expected result count.public static SqlWrapper delete(String sql, Map<String,Integer> namesToIndexes, int expectedCount)
sql - The command.namesToIndexes - A mapping from column name to placeholder index.expectedCount - The expected result count.public static SqlWrapper newWrapper(CommandType type, String sql, Map<String,Integer> namesToIndexes, int expectedCount)
type - A command type.sql - The command.namesToIndexes - A mapping from column name to placeholder index.expectedCount - The expected result count.protected static SqlWrapper prepare(SqlWrapper type, String sql, Map<String,Integer> namesToIndexes, int expectedCount)
type - The instance.sql - The command.namesToIndexes - A mapping from column name to placeholder index.expectedCount - The expected result count.Copyright © 2017. All rights reserved.