public class Insert extends MySqlPart
Generates an INSERT INTO statement for MySQL.
INSERT INTO `tableName` (`col1`, `col2`, `col3`)
VALUES (val1, val2, val3),
(val1, val2, val3),
(val1, val2, val3),...
| Modifier and Type | Method and Description |
|---|---|
Insert |
add(String columnName,
Object value) |
void |
collectSqlFragment(CodeWriter writer) |
InsertRow |
getLastRow() |
List<InsertRow> |
getRows() |
String |
getTable() |
Insert |
nextRow() |
Insert |
setPretty(boolean pretty)
Indicates if line breaks and indentations should be added to output insert statement (default false).
Example output (pretty = true): INSERT INTO `tableName` (`col1`, `col2`, `col3`) |
escapeKeyword, placeBackTickscollectParameterValues, getParameterValues, getSqlFragment, isPretty, printSqlParts, toStringpublic Insert(String table)
public Insert setPretty(boolean pretty)
INSERT INTO `tableName` (`col1`, `col2`, `col3`)
VALUES (val1, val2, val3),
(val1, val2, val3),
(val1, val2, val3),...
INSERT INTO `tableName` (`col1`, `col2`, `col3`) VALUES (val1, val2, val3), (val1, val2, val3), (val1, val2, val3),...public String getTable()
public Insert nextRow()
public InsertRow getLastRow()
public void collectSqlFragment(CodeWriter writer)
collectSqlFragment in class SqlPartCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.