类 StandardSQLFunction
- java.lang.Object
-
- org.hibernate.dialect.function.StandardSQLFunction
-
- 所有已实现的接口:
SQLFunction
- 直接已知子类:
ConditionalParenthesisFunction,DB2SubstringFunction,StandardAnsiSqlAggregationFunctions.AvgFunction,StandardAnsiSqlAggregationFunctions.CountFunction,StandardAnsiSqlAggregationFunctions.MaxFunction,StandardAnsiSqlAggregationFunctions.MinFunction,StandardAnsiSqlAggregationFunctions.SumFunction,StandardJDBCEscapeFunction
public class StandardSQLFunction extends Object implements SQLFunction
Provides a standard implementation that supports the majority of the HQL functions that are translated to SQL. The Dialect and its sub-classes use this class to provide details required for processing of the associated function.- 作者:
- David Channon
-
-
构造器概要
构造器 构造器 说明 StandardSQLFunction(String name)Construct a standard SQL function definition with a variable return type; the actual return type will depend on the types to which the function is applied.StandardSQLFunction(String name, Type registeredType)Construct a standard SQL function definition with a static return type.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetName()Function name accessorprotected StringgetRenderedName(List arguments)TypegetReturnType(Type firstArgumentType, Mapping mapping)The return type of the function.TypegetType()Function static return type accessor.booleanhasArguments()Does this function have any arguments?booleanhasParenthesesIfNoArguments()If there are no arguments, are parentheses required?Stringrender(Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory)Render the function call as SQL fragment.StringtoString()
-
-
-
构造器详细资料
-
StandardSQLFunction
public StandardSQLFunction(String name)
Construct a standard SQL function definition with a variable return type; the actual return type will depend on the types to which the function is applied. Using this form, the return type is considered non-static and assumed to be the type of the first argument.- 参数:
name- The name of the function.
-
-
方法详细资料
-
getName
public String getName()
Function name accessor- 返回:
- The function name.
-
getType
public Type getType()
Function static return type accessor.- 返回:
- The static function return type; or null if return type is not static.
-
hasArguments
public boolean hasArguments()
从接口复制的说明:SQLFunctionDoes this function have any arguments?- 指定者:
hasArguments在接口中SQLFunction- 返回:
- True if the function expects to have parameters; false otherwise.
-
hasParenthesesIfNoArguments
public boolean hasParenthesesIfNoArguments()
从接口复制的说明:SQLFunctionIf there are no arguments, are parentheses required?- 指定者:
hasParenthesesIfNoArguments在接口中SQLFunction- 返回:
- True if a no-arg call of this function requires parentheses.
-
getReturnType
public Type getReturnType(Type firstArgumentType, Mapping mapping)
从接口复制的说明:SQLFunctionThe return type of the function. May be either a concrete type which is preset, or variable depending upon the type of the first function argument. Note, the 'firstArgumentType' parameter should match the one passed intoSQLFunction.render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)- 指定者:
getReturnType在接口中SQLFunction- 参数:
firstArgumentType- The type of the first argumentmapping- The mapping source.- 返回:
- The type to be expected as a return.
-
render
public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory)
从接口复制的说明:SQLFunctionRender the function call as SQL fragment. Note, the 'firstArgumentType' parameter should match the one passed intoSQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)- 指定者:
render在接口中SQLFunction- 参数:
firstArgumentType- The type of the first argumentarguments- The function argumentssessionFactory- The SessionFactory- 返回:
- The rendered function call
-
-