本文整理匯總了Java中gudusoft.gsqlparser.stmt.TUpdateSqlStatement類的典型用法代碼示例。如果您正苦於以下問題:Java TUpdateSqlStatement類的具體用法?Java TUpdateSqlStatement怎麽用?Java TUpdateSqlStatement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TUpdateSqlStatement類屬於gudusoft.gsqlparser.stmt包,在下文中一共展示了TUpdateSqlStatement類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: analyzeStmt
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
public static Stmt analyzeStmt(TCustomSqlStatement stmt) throws NoSqlTypeException {
switch (stmt.sqlstatementtype) {
case sstselect:
return new SelectStmt((TSelectSqlStatement) stmt);
case sstinsert:
return new InsertStmt((TInsertSqlStatement) stmt);
case sstcreatetable:
TCreateTableSqlStatement createStmt = (TCreateTableSqlStatement) stmt;
return new CreateStmt(createStmt);
case sstupdate:
return new UpdateStmt((TUpdateSqlStatement) stmt);
case sstdelete:
return new DeleteStmt((TDeleteSqlStatement) stmt);
case sstmerge:
return new MergeStmt((TMergeSqlStatement) stmt);
case sstaltertable:
break;
case sstcreateview:
break;
default:
throw new NoSqlTypeException();
}
return null;
}
示例2: analyzeStmt
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
@Override
public String analyzeStmt(TCustomSqlStatement stmnt) throws DBAppException {
switch (stmnt.sqlstatementtype) {
case sstcreatetable:
return new CreateParser((TCreateTableSqlStatement) stmnt).parse();
case sstcreateindex:
return new IndexParser((TCreateIndexSqlStatement) stmnt).parse();
case sstinsert:
return new InsertParser((TInsertSqlStatement) stmnt).parse();
case sstupdate:
return new UpdateParser((TUpdateSqlStatement) stmnt).parse();
case sstdelete:
return new DeleteParser((TDeleteSqlStatement) stmnt).parse();
case sstselect:
return new SelectParser((TSelectSqlStatement) stmnt).parse();
default:
throw new UnsupportedStatementException(
stmnt.sqlstatementtype.toString());
}
}
示例3: isDirect_sql_data_statement
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
public static boolean isDirect_sql_data_statement( TCustomSqlStatement stmt )
{
if ( isSql_data_statement( stmt ) )
return false;
if ( stmt instanceof TSelectSqlStatement
|| stmt instanceof TInsertSqlStatement
|| stmt instanceof TUpdateSqlStatement
|| stmt instanceof TDeleteSqlStatement
|| stmt instanceof TMergeSqlStatement )
return true;
return false;
}
示例4: isDirectly_executable_statement
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
public static boolean isDirectly_executable_statement(
TCustomSqlStatement stmt )
{
if ( stmt instanceof TSelectSqlStatement
|| stmt instanceof TInsertSqlStatement
|| stmt instanceof TUpdateSqlStatement
|| stmt instanceof TDeleteSqlStatement
|| stmt instanceof TMergeSqlStatement
|| stmt instanceof TCreateTableSqlStatement
|| stmt instanceof TAlterTableStatement )
return true;
return false;
}
示例5: UpdateStmt
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
public UpdateStmt(TUpdateSqlStatement stmt) throws NoSqlTypeException {
super(stmt);
this.Op = "UPDATE";
// if the target is an alia, it means itself is an source, add it into source in checkAlias function
this.targetTables.add(checkAlias(stmt.tables, stmt.getTargetTable()
.getName()));
// the first one is target, begin from second one
for (int i = 1; i < stmt.tables.size(); i++) {
if (stmt.tables.getTable(i).isBaseTable()) {
this.sourceTables.add(stmt.tables.getTable(i).toString());
//System.out.println(i+stmt.tables.getTable(i).toString());
} else {
this.nestedSource
.add(SqlParser.analyzeStmt(stmt.tables.getTable(i).subquery));
//System.out.println(i+stmt.tables.getTable(i).toString());
}
}
if (stmt.getWhereClause() != null) {
whereClause = stmt.getWhereClause().toString();
// if there is a select in "in" clause, this should also be a source
// this expression can be exreamly complex, can't fit for all
processWhere(stmt);
}
// check the source inside the set clause
TResultColumn a = stmt.getResultColumnList().getResultColumn(0);
TExpression expression = a.getExpr();
TExpression value = expression.getRightOperand();
value.getExpressionType();
if( value.getExpressionType() == EExpressionType.function_t ){
TExpressionList argList = value.getFunctionCall().getArgs();
for(int i=0; i< argList.size(); i++){
TExpression arg = argList.getExpression(i);
if (arg.getExpressionType() == EExpressionType.subquery_t){
Stmt subqury = SqlParser.analyzeStmt(arg.getSubQuery());
this.nestedSource.add(subqury);
}
}
}
}
示例6: UpdateParser
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
public UpdateParser(TUpdateSqlStatement stmnt) {
this.stmnt = stmnt;
}
示例7: convertStmtToModel
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
protected void convertStmtToModel( TCustomSqlStatement stmt,
directly_executable_statement directlyExecutableStatement )
{
if ( Utility.isDirectly_executable_statement( stmt ) )
{
if ( Utility.isDirect_sql_data_statement( stmt ) )
{
direct_sql_data_statement directSqlDataStatement = new direct_sql_data_statement( );
directlyExecutableStatement.setDirect_sql_data_statement( directSqlDataStatement );
if ( stmt instanceof TSelectSqlStatement )
{
TSelectSqlStatement select = (TSelectSqlStatement) stmt;
direct_select_statement_multiple_rows directSelectStatementMultipleRows = new direct_select_statement_multiple_rows( );
directSqlDataStatement.setDirect_select_statement_multiple_rows( directSelectStatementMultipleRows );
convertSelectStmtToModel( select,
directSelectStatementMultipleRows );
}
else if ( stmt instanceof TInsertSqlStatement )
{
TInsertSqlStatement insert = (TInsertSqlStatement) stmt;
insert_statement insertStatement = new insert_statement( );
directSqlDataStatement.setInsert_statement( insertStatement );
convertInsertStmtToModel( insert, insertStatement );
}
else if ( stmt instanceof TUpdateSqlStatement )
{
TUpdateSqlStatement update = (TUpdateSqlStatement) stmt;
update_statement_searched updateStatementSearched = new update_statement_searched( );
directSqlDataStatement.setUpdate_statement_searched( updateStatementSearched );
convertUpdateStmtToModel( update, updateStatementSearched );
}
else if ( stmt instanceof TDeleteSqlStatement )
{
TDeleteSqlStatement delete = (TDeleteSqlStatement) stmt;
delete_statement_searched deleteStatementSearched = new delete_statement_searched( );
directSqlDataStatement.setDelete_statement_searched( deleteStatementSearched );
convertDeleteStmtToModel( delete, deleteStatementSearched );
}
else if ( stmt instanceof TMergeSqlStatement )
{
TMergeSqlStatement merge = (TMergeSqlStatement) stmt;
merge_statement mergeStatement = new merge_statement( );
directSqlDataStatement.setMerge_statement( mergeStatement );
convertMergeStmtToModel( merge, mergeStatement );
}
}
else if ( Utility.isSql_schema_statement( stmt ) )
{
sql_schema_statement sqlSchemaStatement = new sql_schema_statement( );
directlyExecutableStatement.setSql_schema_statement( sqlSchemaStatement );
if ( stmt instanceof TCreateTableSqlStatement )
{
TCreateTableSqlStatement createTable = (TCreateTableSqlStatement) stmt;
sql_schema_definition_statement sql_schema_definition_statement = new sql_schema_definition_statement( );
sqlSchemaStatement.setSql_schema_definition_statement( sql_schema_definition_statement );
table_definition table_definition = new table_definition( );
sql_schema_definition_statement.setTable_definition( table_definition );
convertCreateTableStmtToModel( createTable,
table_definition );
}
else if ( stmt instanceof TAlterTableStatement )
{
TAlterTableStatement alterTable = (TAlterTableStatement) stmt;
sql_schema_manipulation_statement sql_schema_manipulation_statement = new sql_schema_manipulation_statement( );
sqlSchemaStatement.setSql_schema_manipulation_statement( sql_schema_manipulation_statement );
alter_table_statement alter_table_statement = new alter_table_statement( );
sql_schema_manipulation_statement.setAlter_table_statement( alter_table_statement );
convertAlterTableStmtToModel( alterTable,
alter_table_statement );
}
}
}
}
示例8: convertUpdateStmtToModel
import gudusoft.gsqlparser.stmt.TUpdateSqlStatement; //導入依賴的package包/類
private void convertUpdateStmtToModel( TUpdateSqlStatement update,
update_statement_searched updateStatementSearched )
{
TTable table = update.getTargetTable( );
if ( SourceTokenSearcher.indexOf( update.sourcetokenlist,
update.getStartToken( ).posinlist,
table.getStartToken( ).posinlist,
"ONLY" ) != -1 )
{
only_table_name only_table_name = new only_table_name( );
updateStatementSearched.getTarget_table( )
.setOnly_table_name( only_table_name );
convertTableNameToModel( table.getTableName( ),
only_table_name.getTable_name( ) );
}
else
{
table_name table_name = new table_name( );
updateStatementSearched.getTarget_table( )
.setTable_name( table_name );
convertTableNameToModel( table.getTableName( ), table_name );
}
if ( table.getAliasClause( ) != null )
{
as_correlation_name as_correlation_name = new as_correlation_name( );
updateStatementSearched.setAs_correlation_name( as_correlation_name );
if ( table.getAliasClause( ).getAsToken( ) != null )
{
as_correlation_name.setKw_as( "as" );
}
convertObjectNameToModel( table.getAliasClause( ).getAliasName( ),
as_correlation_name.getCorrelation_name( ).getIdentifier( ) );
}
if ( update.getWhereClause( ) != null )
{
where_search_condition where_search_condition = new where_search_condition( );
updateStatementSearched.setWhere_search_condition( where_search_condition );
convertBooleanExpressionToModel( update.getWhereClause( )
.getCondition( ),
where_search_condition.getSearch_condition( )
.getBoolean_value_expression( ) );
}
convertResultColumnListToSetClauseList( updateStatementSearched.getSet_clause_list( )
.getSet_clause( ),
update.getResultColumnList( ) );
}