Package com.exasol.sql.dml.insert
Class AbstractInsertValueTable<T extends AbstractInsertValueTable<T>>
- java.lang.Object
-
- com.exasol.sql.AbstractFragment
-
- com.exasol.sql.dml.insert.AbstractInsertValueTable<T>
-
- Type Parameters:
T- self pointer
- All Implemented Interfaces:
Fragment
- Direct Known Subclasses:
Insert,MergeInsertClause
public abstract class AbstractInsertValueTable<T extends AbstractInsertValueTable<T>> extends AbstractFragment
Abstract base class for SQL fragments that contain a insert value table (for exampleINSERT,MERGE).
-
-
Field Summary
Fields Modifier and Type Field Description protected InsertFieldsinsertFieldsFields to insertprotected ValueTableinsertValueTableTable with values used in theINSERTstatement-
Fields inherited from class com.exasol.sql.AbstractFragment
root
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractInsertValueTable(Fragment root)Create the abstract base for a fragment containing a value table.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcreateInsertValueInstanceIfItDoesNotExist()Prepare the value table.Tfield(String... names)Define fields into which should be inserted.booleanhasFields()Check if a insert fields are defined.booleanhasValues()Check if a value table is present.protected abstract Tself()Generic self pointer.TvaluePlaceholder()Add an unnamed value placeholder to the value list (this is useful for prepared statements).TvaluePlaceholders(int amount)Add a given number unnamed value placeholder to the value list (this is useful for prepared statements).Tvalues(int... values)Insert a list of integer values.Tvalues(ValueExpression... expressions)Insert a list of value expressions.Tvalues(String... values)Insert a list of string values.TvalueTable(ValueTable table)Insert a value table.-
Methods inherited from class com.exasol.sql.AbstractFragment
getRoot
-
-
-
-
Field Detail
-
insertValueTable
protected ValueTable insertValueTable
Table with values used in theINSERTstatement
-
insertFields
protected InsertFields insertFields
Fields to insert
-
-
Constructor Detail
-
AbstractInsertValueTable
protected AbstractInsertValueTable(Fragment root)
Create the abstract base for a fragment containing a value table.- Parameters:
root- root fragment
-
-
Method Detail
-
self
protected abstract T self()
Generic self pointer.- Returns:
- self pointer.
-
createInsertValueInstanceIfItDoesNotExist
protected void createInsertValueInstanceIfItDoesNotExist()
Prepare the value table.
-
field
public T field(String... names)
Define fields into which should be inserted.- Parameters:
names- field names- Returns:
thisfor fluent programming
-
valueTable
public T valueTable(ValueTable table)
Insert a value table.- Parameters:
table- value table to be inserted- Returns:
thisfor fluent programming
-
values
public T values(String... values)
Insert a list of string values.- Parameters:
values- string values to be inserted- Returns:
thisfor fluent programming
-
values
public T values(int... values)
Insert a list of integer values.- Parameters:
values- integer values to be inserted- Returns:
thisfor fluent programming
-
values
public T values(ValueExpression... expressions)
Insert a list of value expressions.- Parameters:
expressions- value expressions to be inserted- Returns:
thisfor fluent programming
-
valuePlaceholder
public T valuePlaceholder()
Add an unnamed value placeholder to the value list (this is useful for prepared statements).- Returns:
thisfor fluent programming
-
valuePlaceholders
public T valuePlaceholders(int amount)
Add a given number unnamed value placeholder to the value list (this is useful for prepared statements).- Parameters:
amount- number of placeholders to be added- Returns:
thisfor fluent programming
-
hasValues
public boolean hasValues()
Check if a value table is present.- Returns:
trueif a value table exists
-
hasFields
public boolean hasFields()
Check if a insert fields are defined.- Returns:
trueif insert fields are defined
-
-