Package org.eclipse.edc.sql.statement
Class SqlExecuteStatement
java.lang.Object
org.eclipse.edc.sql.statement.SqlExecuteStatement
Helps in constructing SQL insert/update statements without having to deal with the SQL syntax directly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a new standard columnGives a SQL delete statement.Gives a SQL delete statement.static org.eclipse.edc.spi.query.CriterionUtility criterion to describe an equality condition in a SQL prepared statement.insertInto(String tableName) Gives a SQL insert statement.static org.eclipse.edc.spi.query.CriterionUtility criterion to describe an "is null" condition in a SQL prepared statement.jsonColumn(String columnName) Add a new json columnstatic SqlExecuteStatementnewInstance(String jsonCastOperator) Create a new instance with the JSON cast operatorGives a SQL update statement.Gives a SQL update statement.upsertInto(String tableName, String idColumn) Gives a SQL upsert statement based on the "ON CONFLICT" semantic
-
Constructor Details
-
SqlExecuteStatement
-
-
Method Details
-
newInstance
Create a new instance with the JSON cast operator- Parameters:
jsonCastOperator- the json cast operator.- Returns:
- a new
SqlExecuteStatement.
-
equalTo
Utility criterion to describe an equality condition in a SQL prepared statement.- Parameters:
columnName- the column name.- Returns:
- the criterion.
-
isNull
Utility criterion to describe an "is null" condition in a SQL prepared statement.- Parameters:
columnName- the column name.- Returns:
- the criterion.
-
column
Add a new standard column- Parameters:
columnName- the column name.- Returns:
- the
SqlExecuteStatement.
-
jsonColumn
Add a new json column- Parameters:
columnName- the column name.- Returns:
- the
SqlExecuteStatement.
-
insertInto
Gives a SQL insert statement.- Parameters:
tableName- the table name.- Returns:
- sql insert statement.
-
update
Gives a SQL update statement.- Parameters:
tableName- the table name.whereColumn- the column that will be used for the where condition- Returns:
- sql update statement.
-
update
Gives a SQL update statement.- Parameters:
tableName- the table name.where- the update field criterion- Returns:
- sql update statement.
-
delete
Gives a SQL delete statement.- Parameters:
tableName- the table name.whereColumn- the column that will be used for the where condition- Returns:
- sql delete statement.
-
delete
Gives a SQL delete statement. The where criteria is joined with AND operator.- Parameters:
tableName- the table name.whereCriteria- the delete field condition- Returns:
- sql delete statement.
-
upsertInto
Gives a SQL upsert statement based on the "ON CONFLICT" semantic- Parameters:
tableName- the table name.idColumn- the id column.- Returns:
- sql upsert statement.
-