Package com.gengoai.sql.statement
Class Insert
- java.lang.Object
-
- com.gengoai.sql.statement.Insert
-
- All Implemented Interfaces:
SQLElement
,UpdateStatement
,Serializable
public class Insert extends Object implements UpdateStatement
SQL Insert Statement
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Insert
columns(@NonNull SQLElement... columns)
Set the named columns being inserted (note that calling this removed previously specified columns).Insert
columns(@NonNull String... columns)
Set the named columns being inserted (note that calling this removed previously specified columns).Insert
columns(@NonNull Collection<? extends SQLElement> columns)
Set the named columns being inserted (note that calling this removed previously specified columns).Insert
defaultValues()
Sets the values to be inserted as default (note that this will remove any previously set values or select statement).Insert
indexedParameters()
Sets the values to be inserted as indexed parameters for use withPreparedStatement
(note that this will remove any previously set values or select statement).static Insert
into(@NonNull Table table)
Create an Insert statement that will insert into the given table.static Insert
into(@NonNull SQLElement table)
Create an Insert statement that will insert into the givenSQLElement
.Insert
namedParameters()
Sets the values to be inserted as named parameters for use withNamedPreparedStatement
(note that this will remove any previously set values or select statement).Insert
onConflict(@NonNull UpsertClause upsertClause)
Sets the upsert clause to use if an index conflict results from the insertionInsert
select(@NonNull QueryStatement select)
Sets the select statement to use for inserting values (note that this removes all previously set values or default values).Insert
type(@NonNull InsertType insertType)
Sets the insertion type of the insert statement.Insert
values(@NonNull SQLElement... values)
Sets the values to be inserted (note that this will remove any previously set values or select statement).Insert
values(@NonNull Collection<? extends SQLElement> values)
Sets the values to be inserted (note that this will remove any previously set values or select statement).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.sql.SQLElement
getClassName
-
-
-
-
Method Detail
-
into
public static Insert into(@NonNull @NonNull Table table)
Create an Insert statement that will insert into the given table.- Parameters:
table
- the table to insert into- Returns:
- the Insert statement
-
into
public static Insert into(@NonNull @NonNull SQLElement table)
Create an Insert statement that will insert into the givenSQLElement
.- Parameters:
table
- the table to insert into represented as aSQLElement
- Returns:
- the Insert statement
-
columns
public Insert columns(@NonNull @NonNull SQLElement... columns)
Set the named columns being inserted (note that calling this removed previously specified columns).- Parameters:
columns
- the columns to insert- Returns:
- this Insert statement
-
columns
public Insert columns(@NonNull @NonNull String... columns)
Set the named columns being inserted (note that calling this removed previously specified columns).- Parameters:
columns
- the columns to insert- Returns:
- this Insert statement
-
columns
public Insert columns(@NonNull @NonNull Collection<? extends SQLElement> columns)
Set the named columns being inserted (note that calling this removed previously specified columns).- Parameters:
columns
- the columns to insert- Returns:
- this Insert statement
-
defaultValues
public Insert defaultValues()
Sets the values to be inserted as default (note that this will remove any previously set values or select statement).- Returns:
- this Insert statement
-
indexedParameters
public Insert indexedParameters()
Sets the values to be inserted as indexed parameters for use withPreparedStatement
(note that this will remove any previously set values or select statement).- Returns:
- this Insert statement
-
namedParameters
public Insert namedParameters()
Sets the values to be inserted as named parameters for use withNamedPreparedStatement
(note that this will remove any previously set values or select statement).- Returns:
- this Insert statement
-
onConflict
public Insert onConflict(@NonNull @NonNull UpsertClause upsertClause)
Sets the upsert clause to use if an index conflict results from the insertion- Parameters:
upsertClause
- the upsert clause- Returns:
- this Insert statement
-
select
public Insert select(@NonNull @NonNull QueryStatement select)
Sets the select statement to use for inserting values (note that this removes all previously set values or default values).- Parameters:
select
- the select statement to use for inserting values- Returns:
- this Insert statement
-
type
public Insert type(@NonNull @NonNull InsertType insertType)
Sets the insertion type of the insert statement.- Parameters:
insertType
- this Insert statement type- Returns:
- this Insert statement
-
values
public Insert values(@NonNull @NonNull SQLElement... values)
Sets the values to be inserted (note that this will remove any previously set values or select statement).- Parameters:
values
- the values to insert- Returns:
- this Insert statement
-
values
public Insert values(@NonNull @NonNull Collection<? extends SQLElement> values)
Sets the values to be inserted (note that this will remove any previously set values or select statement).- Parameters:
values
- the values to insert- Returns:
- this Insert statement
-
-