本文整理汇总了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();
}
}
示例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();
}
示例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;
}