public abstract class Prepared extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
create
Whether to create a new object (for indexes).
|
protected ArrayList<Parameter> |
parameters
The list of parameters.
|
protected boolean |
prepareAlways
If the query should be prepared before each execution.
|
protected SessionLocal |
session
The session.
|
protected String |
sqlStatement
The SQL string.
|
protected ArrayList<Token> |
sqlTokens
The SQL tokens.
|
| 构造器和说明 |
|---|
Prepared(SessionLocal session)
Create a new object.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkCanceled()
Check if this statement was canceled.
|
protected void |
checkParameters()
Check if all parameters have been set.
|
void |
collectDependencies(HashSet<DbObject> dependencies)
Find and collect all DbObjects, this Prepared depends on.
|
List<TableView> |
getCteCleanups() |
long |
getCurrentRowNumber()
Get the current row number.
|
protected int |
getObjectId()
Get the current object id, or get a new id from the database.
|
ArrayList<Parameter> |
getParameters()
Get the parameter list.
|
int |
getPersistedObjectId()
Get the object id to use for the database object that is created in this
statement.
|
String |
getPlanSQL(int sqlFlags)
Get the SQL statement with the execution plan.
|
SessionLocal |
getSession() |
static String |
getSimpleSQL(Expression[] list)
Get the SQL snippet of the expression list.
|
String |
getSQL()
Get the SQL statement.
|
ArrayList<Token> |
getSQLTokens()
Get the SQL tokens.
|
abstract int |
getType()
Get the command type as defined in CommandInterface
|
boolean |
isCacheable() |
boolean |
isQuery()
Check if this object is a query.
|
boolean |
isReadOnly()
Check if this command is read only.
|
abstract boolean |
isTransactional()
Check if this command is transactional.
|
boolean |
isWithParamValues()
Returns whether values of parameters were specified in SQL.
|
boolean |
needRecompile()
Check if the statement needs to be re-compiled.
|
void |
prepare()
Prepare this statement.
|
ResultInterface |
query(long maxrows)
Execute the query.
|
abstract ResultInterface |
queryMeta()
Get an empty result set containing the meta data.
|
void |
setCommand(Command command)
Set the command.
|
void |
setCteCleanups(List<TableView> cteCleanups)
Set the temporary views created for CTE's.
|
void |
setCurrentRowNumber(long rowNumber)
Set the current row number.
|
void |
setParameterList(ArrayList<Parameter> parameters)
Set the parameter list of this statement.
|
void |
setPersistedObjectId(int i)
Set the persisted object id for this statement.
|
void |
setPrepareAlways(boolean prepareAlways)
Set the prepare always flag.
|
protected DbException |
setRow(DbException e,
long rowId,
String values)
Set the SQL statement of the exception to the given row.
|
void |
setSession(SessionLocal currentSession)
Set the session for this statement.
|
void |
setSQL(String sql,
ArrayList<Token> sqlTokens)
Set the SQL statement.
|
void |
setWithParamValues(boolean withParamValues)
Sets whether values of parameters were specified in SQL.
|
String |
toString()
Convert the statement to a String.
|
long |
update()
Execute the statement.
|
protected SessionLocal session
protected String sqlStatement
protected boolean create
protected boolean prepareAlways
public Prepared(SessionLocal session)
session - the sessionpublic abstract boolean isTransactional()
public abstract ResultInterface queryMeta()
public abstract int getType()
public boolean isReadOnly()
public boolean needRecompile()
public void setParameterList(ArrayList<Parameter> parameters)
parameters - the parameter listpublic ArrayList<Parameter> getParameters()
public boolean isWithParamValues()
public void setWithParamValues(boolean withParamValues)
withParamValues - are values of parameters were specified in SQLprotected void checkParameters()
DbException - if any parameter has not been setpublic void setCommand(Command command)
command - the new commandpublic boolean isQuery()
public void prepare()
public long update()
DbException - if it is a querypublic ResultInterface query(long maxrows)
maxrows - the maximum number of rows to returnDbException - if it is not a querypublic final void setSQL(String sql, ArrayList<Token> sqlTokens)
sql - the SQL statementsqlTokens - the SQL tokenspublic final String getSQL()
public int getPersistedObjectId()
protected int getObjectId()
public String getPlanSQL(int sqlFlags)
sqlFlags - formatting flagspublic void checkCanceled()
DbException - if it was canceledpublic void setPersistedObjectId(int i)
i - the object idpublic void setSession(SessionLocal currentSession)
currentSession - the new sessionpublic void setPrepareAlways(boolean prepareAlways)
prepareAlways - the new valuepublic void setCurrentRowNumber(long rowNumber)
rowNumber - the row numberpublic long getCurrentRowNumber()
public String toString()
public static String getSimpleSQL(Expression[] list)
list - the expression listprotected DbException setRow(DbException e, long rowId, String values)
e - the exceptionrowId - the row numbervalues - the values of the rowpublic boolean isCacheable()
public void setCteCleanups(List<TableView> cteCleanups)
cteCleanups - the temporary viewspublic final SessionLocal getSession()
Copyright © 2022. All rights reserved.