本文整理汇总了Java中gudusoft.gsqlparser.TCustomSqlStatement类的典型用法代码示例。如果您正苦于以下问题:Java TCustomSqlStatement类的具体用法?Java TCustomSqlStatement怎么用?Java TCustomSqlStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TCustomSqlStatement类属于gudusoft.gsqlparser包,在下文中一共展示了TCustomSqlStatement类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: analyzeStmt
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的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: DeleteStmt
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的package包/类
public DeleteStmt(TCustomSqlStatement stmt) throws NoSqlTypeException {
super(stmt);
this.Op = "DELETE";
//System.out.print(stmt.tables.getTable(0));
//System.out.print(checkAlias(stmt.tables, stmt.getTargetTable().getName()));
this.targetTables.add(checkAlias(stmt.tables, stmt.getTargetTable()
.getName()));
for (int i = 0; i < stmt.tables.size(); i++) {
if (! stmt.tables.getTable(i).toString().equals( this.targetTables.get(0)))
this.sourceTables.add(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);
}
}
示例3: analyzeStmt
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的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());
}
}
示例4: Stmt
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的package包/类
public Stmt(TCustomSqlStatement stmt) {
sourceTables = new ArrayList<String>();
targetTables = new ArrayList<String>();
nestedSource = new ArrayList<Stmt>();
nestedTarget = new ArrayList<Stmt>();
}
示例5: isDirect_sql_data_statement
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的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;
}
示例6: isSql_data_statement
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的package包/类
public static boolean isSql_data_statement( TCustomSqlStatement stmt )
{
if ( stmt instanceof TDeleteSqlStatement )
{
if ( stmt.getWhereClause( ) != null
&& stmt.getWhereClause( ).isCurerntOf( ) )
{
return true;
}
}
return false;
}
示例7: isSql_schema_statement
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的package包/类
public static boolean isSql_schema_statement( TCustomSqlStatement stmt )
{
if ( stmt instanceof TCreateTableSqlStatement )
return true;
if ( stmt instanceof TAlterTableStatement )
return true;
return false;
}
示例8: isDirectly_executable_statement
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的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;
}
示例9: convertStmtToModel
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的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 );
}
}
}
}
示例10: processWhere
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的package包/类
protected void processWhere(TCustomSqlStatement stmt) throws NoSqlTypeException {
processExpression(stmt.getWhereClause().getCondition());
}
示例11: analyzeStmt
import gudusoft.gsqlparser.TCustomSqlStatement; //导入依赖的package包/类
public String analyzeStmt(TCustomSqlStatement stmnt) throws DBAppException;