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


Java CursorNode.init方法代碼示例

本文整理匯總了Java中com.foundationdb.sql.parser.CursorNode.init方法的典型用法代碼示例。如果您正苦於以下問題:Java CursorNode.init方法的具體用法?Java CursorNode.init怎麽用?Java CursorNode.init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.foundationdb.sql.parser.CursorNode的用法示例。


在下文中一共展示了CursorNode.init方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addLimitCondtionForSelectSQL

import com.foundationdb.sql.parser.CursorNode; //導入方法依賴的package包/類
public static String addLimitCondtionForSelectSQL(RouteResultset rrs,
		CursorNode cursNode, int defaultMaxLimit)
		throws SQLSyntaxErrorException {
	NumericConstantNode offCountNode = new NumericConstantNode();
	offCountNode.setNodeType(NodeTypes.INT_CONSTANT_NODE);
	offCountNode.setValue(defaultMaxLimit);
	cursNode.init(cursNode.statementToString(),
			cursNode.getResultSetNode(), cursNode.getName(),
			cursNode.getOrderByList(), cursNode.getOffsetClause(),
			offCountNode, cursNode.getUpdateMode(),
			cursNode.getUpdatableColumns());
	rrs.setLimitSize(defaultMaxLimit);
	try {
		return new NodeToString().toString(cursNode);
	} catch (StandardException e) {
		throw new SQLSyntaxErrorException(e);
	}
}
 
開發者ID:youngor,項目名稱:openclouddb,代碼行數:19,代碼來源:SelectSQLAnalyser.java

示例2: addLimitCondtionForSelectSQL

import com.foundationdb.sql.parser.CursorNode; //導入方法依賴的package包/類
public static String addLimitCondtionForSelectSQL(RouteResultset rrs,
		CursorNode cursNode, int defaultMaxLimit) throws SQLSyntaxErrorException {
	NumericConstantNode offCountNode = new NumericConstantNode();
	offCountNode.setNodeType(NodeTypes.INT_CONSTANT_NODE);
	offCountNode.setValue(defaultMaxLimit);
	cursNode.init(cursNode.statementToString(),
			cursNode.getResultSetNode(), cursNode.getName(),
			cursNode.getOrderByList(), cursNode.getOffsetClause(),
			offCountNode, cursNode.getUpdateMode(),
			cursNode.getUpdatableColumns());
	rrs.setLimitSize(defaultMaxLimit);
	try {
		return new NodeToString().toString(cursNode);
	} catch (StandardException e) {
		throw new SQLSyntaxErrorException(e);
	}
}
 
開發者ID:youngor,項目名稱:openclouddb,代碼行數:18,代碼來源:SelectSQLAnalyser.java

示例3: findAndSetTypes

import com.foundationdb.sql.parser.CursorNode; //導入方法依賴的package包/類
/** Run just enough rules to get to TypeResolver, then set types. */
protected void findAndSetTypes(AISViewDefinition view) {
    FromSubquery fromSubquery = view.getSubquery();

    // put the SELECT in a cursorNode to enable bindAndTransform/statementLoader/etc on it.
    CursorNode cursorNode = new CursorNode();
    cursorNode.init("SELECT",
            fromSubquery.getSubquery(),
            view.getName().getFullTableName(),
            fromSubquery.getOrderByList(),
            fromSubquery.getOffset(),
            fromSubquery.getFetchFirst(),
            UpdateMode.UNSPECIFIED,
            null);
    cursorNode.setNodeType(NodeTypes.CURSOR_NODE);
    bindAndTransform(cursorNode);
    copyExposedNames(fromSubquery.getResultColumns(), fromSubquery.getSubquery().getResultColumns());
    fromSubquery.setResultColumns(fromSubquery.getSubquery().getResultColumns());

    PlanContext plan = new PlanContext(this);
    plan.setPlan(new AST(cursorNode, null));

    // can't user OperatorCompiler.compile, because it expects to return BasePlannable
    ASTStatementLoader stmtLoader = new ASTStatementLoader();
    stmtLoader.apply(plan);

    TypeResolver typeResolver = new TypeResolver();
    typeResolver.apply(plan);

    copyTypes((ResultSet) ((SelectQuery)plan.getPlan()).getInput(), fromSubquery.getResultColumns());
    
}
 
開發者ID:jaytaylor,項目名稱:sql-layer,代碼行數:33,代碼來源:ViewCompiler.java


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