當前位置: 首頁>>代碼示例>>Java>>正文


Java TCustomSqlStatement類代碼示例

本文整理匯總了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;
}
 
開發者ID:linkedin,項目名稱:WhereHows,代碼行數:25,代碼來源:SqlParser.java

示例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);
    }
}
 
開發者ID:linkedin,項目名稱:WhereHows,代碼行數:23,代碼來源:DeleteStmt.java

示例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());
	}
}
 
開發者ID:KhaledHelmy,項目名稱:DB2-Project,代碼行數:21,代碼來源:Parser.java

示例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>();
}
 
開發者ID:linkedin,項目名稱:WhereHows,代碼行數:8,代碼來源:Stmt.java

示例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;
}
 
開發者ID:sqlparser,項目名稱:sql2xml,代碼行數:13,代碼來源:Utility.java

示例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;
}
 
開發者ID:sqlparser,項目名稱:sql2xml,代碼行數:13,代碼來源:Utility.java

示例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;
}
 
開發者ID:sqlparser,項目名稱:sql2xml,代碼行數:9,代碼來源:Utility.java

示例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;
}
 
開發者ID:sqlparser,項目名稱:sql2xml,代碼行數:14,代碼來源:Utility.java

示例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 );
			}
		}
	}
}
 
開發者ID:sqlparser,項目名稱:sql2xml,代碼行數:75,代碼來源:AnsiGenerator.java

示例10: processWhere

import gudusoft.gsqlparser.TCustomSqlStatement; //導入依賴的package包/類
protected void processWhere(TCustomSqlStatement stmt) throws NoSqlTypeException {

        processExpression(stmt.getWhereClause().getCondition());
    }
 
開發者ID:linkedin,項目名稱:WhereHows,代碼行數:5,代碼來源:Stmt.java

示例11: analyzeStmt

import gudusoft.gsqlparser.TCustomSqlStatement; //導入依賴的package包/類
public String analyzeStmt(TCustomSqlStatement stmnt) throws DBAppException; 
開發者ID:KhaledHelmy,項目名稱:DB2-Project,代碼行數:2,代碼來源:ParserInterface.java


注:本文中的gudusoft.gsqlparser.TCustomSqlStatement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。