Package com.sap.cds.ql.cqn
Interface CqnStatement
-
- All Superinterfaces:
JSONizable
- All Known Subinterfaces:
CqnDelete
,CqnInsert
,CqnSelect
,CqnUpdate
,CqnUpsert
,CqnXsert
,Delete<T>
,Insert
,Update<T>
,Upsert
- All Known Implementing Classes:
Select
,StatementBuilder
public interface CqnStatement extends JSONizable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CqnDelete
asDelete()
Casts this CQN statement toCqnDelete
.default CqnInsert
asInsert()
Casts this CQN statement toCqnInsert
.default CqnSelect
asSelect()
Casts this CQN statement toCqnSelect
.default CqnUpdate
asUpdate()
Casts this CQN statement toCqnUpdate
.default CqnUpsert
asUpsert()
Casts this CQN statement toCqnUpsert
.Map<String,Object>
hints()
Returns the runtime hints of this statement.default boolean
isDelete()
Returnstrue
if this is aCqnDelete
statement.default boolean
isInsert()
Returnstrue
if this is aCqnInsert
statement.default boolean
isSelect()
Returnstrue
if this is aCqnSelect
statement.default boolean
isUpdate()
Returnstrue
if this is aCqnUpdate
statement.default boolean
isUpsert()
Returnstrue
if this is aCqnUpsert
statement.CqnStructuredTypeRef
ref()
Returns the reference of this statement.-
Methods inherited from interface com.sap.cds.JSONizable
toJson
-
-
-
-
Method Detail
-
ref
CqnStructuredTypeRef ref()
Returns the reference of this statement.CqnSelect
statements do not necessarily have a reference, e.g. a select from subquery. This can be checked viaCqnSelect.from()
.- Returns:
- the reference
- Throws:
CdsException
- if this statement does not have a reference
-
hints
Map<String,Object> hints()
Returns the runtime hints of this statement.- Returns:
- the runtime hints
-
isSelect
default boolean isSelect()
Returnstrue
if this is aCqnSelect
statement.- Returns:
true
if this is a select statement, otherwisefalse
-
isInsert
default boolean isInsert()
Returnstrue
if this is aCqnInsert
statement.- Returns:
true
if this is an insert statement, otherwisefalse
-
isUpsert
default boolean isUpsert()
Returnstrue
if this is aCqnUpsert
statement.- Returns:
true
if this is an upsert statement, otherwisefalse
-
isUpdate
default boolean isUpdate()
Returnstrue
if this is aCqnUpdate
statement.- Returns:
true
if this is an update statement, otherwisefalse
-
isDelete
default boolean isDelete()
Returnstrue
if this is aCqnDelete
statement.- Returns:
true
if this is a delete statement, otherwisefalse
-
asSelect
default CqnSelect asSelect()
Casts this CQN statement toCqnSelect
.- Returns:
- this statement as a CqnSelect
- Throws:
ClassCastException
- if this statement is not a select
-
asInsert
default CqnInsert asInsert()
Casts this CQN statement toCqnInsert
.- Returns:
- this statement as a CqnInsert
- Throws:
ClassCastException
- if this statement is not an insert
-
asUpsert
default CqnUpsert asUpsert()
Casts this CQN statement toCqnUpsert
.- Returns:
- this statement as a CqnUpsert
- Throws:
ClassCastException
- if this statement is not an upsert
-
asUpdate
default CqnUpdate asUpdate()
Casts this CQN statement toCqnUpdate
.- Returns:
- this statement as a CqnUpdate
- Throws:
ClassCastException
- if this statement is not an update
-
asDelete
default CqnDelete asDelete()
Casts this CQN statement toCqnDelete
.- Returns:
- this statement as a CqnDelete
- Throws:
ClassCastException
- if this statement is not a delete
-
-