本文整理汇总了Java中com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.isForUpdate方法的典型用法代码示例。如果您正苦于以下问题:Java MySqlSelectQueryBlock.isForUpdate方法的具体用法?Java MySqlSelectQueryBlock.isForUpdate怎么用?Java MySqlSelectQueryBlock.isForUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock
的用法示例。
在下文中一共展示了MySqlSelectQueryBlock.isForUpdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: statementParse
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock; //导入方法依赖的package包/类
@Override
public void statementParse(SchemaConfig schema, RouteResultset rrs, SQLStatement stmt) {
SQLSelectStatement selectStmt = (SQLSelectStatement)stmt;
SQLSelectQuery sqlSelectQuery = selectStmt.getSelect().getQuery();
if(sqlSelectQuery instanceof MySqlSelectQueryBlock) {
MySqlSelectQueryBlock mysqlSelectQuery = (MySqlSelectQueryBlock)selectStmt.getSelect().getQuery();
parseOrderAggGroupMysql(schema, stmt,rrs, mysqlSelectQuery);
//更改canRunInReadDB属性
if ((mysqlSelectQuery.isForUpdate() || mysqlSelectQuery.isLockInShareMode()) && rrs.isAutocommit() == false)
{
rrs.setCanRunInReadDB(false);
}
} else if (sqlSelectQuery instanceof MySqlUnionQuery) {
// MySqlUnionQuery unionQuery = (MySqlUnionQuery)sqlSelectQuery;
// MySqlSelectQueryBlock left = (MySqlSelectQueryBlock)unionQuery.getLeft();
// MySqlSelectQueryBlock right = (MySqlSelectQueryBlock)unionQuery.getLeft();
// System.out.println();
}
}
示例2: statementParse
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock; //导入方法依赖的package包/类
@Override
public void statementParse(SchemaConfig schema, RouteResultset rrs, SQLStatement stmt) {
SQLSelectStatement selectStmt = (SQLSelectStatement)stmt;
SQLSelectQuery sqlSelectQuery = selectStmt.getSelect().getQuery();
//从mysql解析过来
if(sqlSelectQuery instanceof MySqlSelectQueryBlock) {
MySqlSelectQueryBlock mysqlSelectQuery = (MySqlSelectQueryBlock)selectStmt.getSelect().getQuery();
Limit limit=mysqlSelectQuery.getLimit();
if(limit==null)
{
//使用oracle的解析,否则会有部分oracle语法识别错误
OracleStatementParser oracleParser = new OracleStatementParser(getCtx().getSql());
SQLSelectStatement oracleStmt = (SQLSelectStatement) oracleParser.parseStatement();
selectStmt= oracleStmt;
SQLSelectQuery oracleSqlSelectQuery = oracleStmt.getSelect().getQuery();
if(oracleSqlSelectQuery instanceof OracleSelectQueryBlock)
{
parseNativePageSql(oracleStmt, rrs, (OracleSelectQueryBlock) oracleSqlSelectQuery, schema);
}
}
if(isNeedParseOrderAgg)
{
parseOrderAggGroupMysql(schema, selectStmt,rrs, mysqlSelectQuery);
//更改canRunInReadDB属性
if ((mysqlSelectQuery.isForUpdate() || mysqlSelectQuery.isLockInShareMode()) && rrs.isAutocommit() == false)
{
rrs.setCanRunInReadDB(false);
}
}
}
}
示例3: statementParse
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock; //导入方法依赖的package包/类
@Override
public void statementParse(SchemaConfig schema, RouteResultset rrs, SQLStatement stmt) {
SQLSelectStatement selectStmt = (SQLSelectStatement)stmt;
SQLSelectQuery sqlSelectQuery = selectStmt.getSelect().getQuery();
//从mysql解析过来
if(sqlSelectQuery instanceof MySqlSelectQueryBlock) {
MySqlSelectQueryBlock mysqlSelectQuery = (MySqlSelectQueryBlock)selectStmt.getSelect().getQuery();
MySqlSelectQueryBlock.Limit limit=mysqlSelectQuery.getLimit();
if(limit==null)
{
sqlserverParse(schema, rrs);
}
if(isNeedParseOrderAgg)
{
parseOrderAggGroupMysql(schema, stmt,rrs, mysqlSelectQuery);
//更改canRunInReadDB属性
if ((mysqlSelectQuery.isForUpdate() || mysqlSelectQuery.isLockInShareMode()) && rrs.isAutocommit() == false)
{
rrs.setCanRunInReadDB(false);
}
}
}
}