当前位置: 首页>>代码示例>>Java>>正文


Java SQLFunction.hasParenthesesIfNoArguments方法代码示例

本文整理汇总了Java中org.hibernate.dialect.function.SQLFunction.hasParenthesesIfNoArguments方法的典型用法代码示例。如果您正苦于以下问题:Java SQLFunction.hasParenthesesIfNoArguments方法的具体用法?Java SQLFunction.hasParenthesesIfNoArguments怎么用?Java SQLFunction.hasParenthesesIfNoArguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.dialect.function.SQLFunction的用法示例。


在下文中一共展示了SQLFunction.hasParenthesesIfNoArguments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isFunctionName

import org.hibernate.dialect.function.SQLFunction; //导入方法依赖的package包/类
@Override
@SuppressWarnings("SimplifiableIfStatement")
protected boolean isFunctionName(AST ast) {
	/*
	 * Semantic predicate used to determine whether a given AST node represents a function call
	 */

	AST child = ast.getFirstChild();
	// assume it is a function if it has parameters
	if ( child != null && "{param list}".equals( child.getText() ) ) {
		return true;
	}

	// otherwise, in order for this to be a function logically it has to be a function that does not
	// have arguments.  So try to assert that using the registry of known functions
	final SQLFunction function = context.getSqlFunctionRegistry().findSQLFunction( ast.getText() );
	if ( function == null ) {
		// no registered function, so we cannot know for certain
		return false;
	}
	else {
		// if function.hasParenthesesIfNoArguments() is true, then assume the node is not a function
		return ! function.hasParenthesesIfNoArguments();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:OrderByFragmentParser.java

示例2: isFunction

import org.hibernate.dialect.function.SQLFunction; //导入方法依赖的package包/类
private static boolean isFunction(String lcToken, String nextToken, SQLFunctionRegistry functionRegistry) {
	// checking for "(" is currently redundant because it is checked before getting here;
	// doing the check anyhow, in case that earlier check goes away;
	if ( "(".equals( nextToken ) ) {
		return true;
	}
	SQLFunction function = functionRegistry.findSQLFunction(lcToken);
	if ( function == null ) {
		// lcToken does not refer to a function
		return false;
	}
	// if function.hasParenthesesIfNoArguments() is true, then assume
	// lcToken is not a function (since it is not followed by '(')
	return ! function.hasParenthesesIfNoArguments();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:Template.java

示例3: locateAppropriateDialectFunctionNameForAliasTest

import org.hibernate.dialect.function.SQLFunction; //导入方法依赖的package包/类
private String locateAppropriateDialectFunctionNameForAliasTest() {
	for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) {
		final Map.Entry entry = (Map.Entry) itr.next();
		final SQLFunction function = (SQLFunction) entry.getValue();
		if ( !function.hasArguments() && !function.hasParenthesesIfNoArguments() ) {
			return (String) entry.getKey();
		}
	}
	return null;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:11,代码来源:SQLFunctionsTest.java


注:本文中的org.hibernate.dialect.function.SQLFunction.hasParenthesesIfNoArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。