当前位置: 首页>>代码示例>>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;未经允许,请勿转载。