public abstract class OpenSqlWriteStatement extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ShallowEntity |
entity
An entity representing an OpenSQL statement directly or an entity
representing a macro which contains an OpenSQL statement.
|
protected java.util.List<IToken> |
tokens
The tokens that constitute the statement.
|
protected ITypeResolution |
typeResolution
Type resolution of OpenSQL statement.
|
Modifier and Type | Method and Description |
---|---|
static OpenSqlWriteStatement |
create(ShallowEntity entity,
java.util.List<IToken> tokens,
ITypeResolution typeResolution)
Factory method.
|
IToken |
getStatementStartToken()
Gets the statement start token, e.g.
|
java.lang.String |
getTableName()
Returns the name of the targeted table in upper case.
|
IToken |
getTableNameToken()
Returns the
IToken holding the table name |
protected int |
getTableTokenIndex()
Determines the token index at which the table name starts.
|
protected abstract boolean |
hasSureITabSyntax()
Checks whether the statement is targeted at an internal table.
|
boolean |
targetsInternalTable()
Checks whether the target table of the statement is a variable.
|
boolean |
targetsStandardDatabaseTable()
Checks whether the statement targets a standard database table, i.e.
|
protected ShallowEntity entity
protected ITypeResolution typeResolution
protected int getTableTokenIndex()
protected abstract boolean hasSureITabSyntax()
public boolean targetsInternalTable()
public IToken getStatementStartToken()
public java.lang.String getTableName()
public IToken getTableNameToken()
IToken
holding the table namepublic boolean targetsStandardDatabaseTable()
ITypeResolution
to
distinguish local variables from standard tables.public static OpenSqlWriteStatement create(ShallowEntity entity, java.util.List<IToken> tokens, ITypeResolution typeResolution)
tokens
must be one of INSERT, MODIFY, UPDATE, DELETE.
Returns null
if passed token list is not an OpenSQL statement
targeting a database table.java.lang.IllegalArgumentException
- In case the statement has an unsupported type.