Class StatementBuilder
java.lang.Object
net.sf.jailer.database.StatementBuilder
Builds compact SQL-statements of the pattern:
HEAD ITEM {SEPARATOR ITEM}* TERMINATOR.
(for example, an 'INSERT' with a 'values'-list)
- Author:
- Ralf Wisser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends an item.build()Builds the SQL-statement and resets the builder.getItems()Returns the items of the current statement.intGets the maximal size of a body-list.booleanisAppendable(String head) Checks whether an item is appendable to previously appended items.booleanisEmpty()Checks if builder is empty.intsize()Returns the number of items in the current statement.
-
Constructor Details
-
StatementBuilder
public StatementBuilder(int maxBodySize) Constructor.- Parameters:
maxBodySize- the maximal size of a body-list
-
-
Method Details
-
isAppendable
Checks whether an item is appendable to previously appended items.- Parameters:
head- the statements head- Returns:
trueiff item is appendable
-
build
-
append
-
isEmpty
public boolean isEmpty()Checks if builder is empty.- Returns:
trueif builder is empty
-
size
public int size()Returns the number of items in the current statement.- Returns:
- the number of items
-
getItems
-
getMaxBodySize
public int getMaxBodySize()Gets the maximal size of a body-list.- Returns:
- the maximal number of items per statement
-