Class SqlPart
java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
- Direct Known Subclasses:
CreatePostgreSqlDdlFromSchemaDef,Delete,H2SqlPart,Insert,InsertRow,InsertValue,Merge,MergeValue,MySqlPart,OnConflict,PostgresSqlPart,QueryPart,QuerySource,Update,UpdateValue
Base class for the SQL builders: renders a SQL fragment and collects the values for its
? parameters.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectParameterValues(List<Object> values) Appends the values for this part's?parameters to the list in order; adds nothing by default.abstract voidcollectSqlFragment(CodeWriter writer) Writes this part's SQL to the writer; used bygetSqlFragment()and by enclosing parts.final Object[]Returns the values for this part's?parameters in order, or an empty array if there are none.final StringReturns this part's SQL, formatted as set bysetPretty(boolean), with trailing whitespace removed.booleanisPretty()Indicates ifgetSqlFragment()adds line breaks and indentation instead of using one line (default is false).protected static voidprintSqlParts(CodeWriter writer, List<? extends SqlPart> parts, String separator) Writes the SQL of each part to the writer, separated byseparator.setPretty(boolean pretty) Indicates ifgetSqlFragment()adds line breaks and indentation instead of using one line (default is false).final StringtoString()
-
Constructor Details
-
SqlPart
public SqlPart()
-
-
Method Details
-
isPretty
public boolean isPretty()Indicates ifgetSqlFragment()adds line breaks and indentation instead of using one line (default is false). -
setPretty
Indicates ifgetSqlFragment()adds line breaks and indentation instead of using one line (default is false). -
collectSqlFragment
Writes this part's SQL to the writer; used bygetSqlFragment()and by enclosing parts. -
getSqlFragment
Returns this part's SQL, formatted as set bysetPretty(boolean), with trailing whitespace removed. -
collectParameterValues
Appends the values for this part's?parameters to the list in order; adds nothing by default. -
getParameterValues
Returns the values for this part's?parameters in order, or an empty array if there are none. -
toString
-
printSqlParts
protected static void printSqlParts(CodeWriter writer, List<? extends SqlPart> parts, String separator) Writes the SQL of each part to the writer, separated byseparator.
-