Top Description Fields Constructors Methods
org.hibernate.dialect.function

public Class CurrentFunction

extends AbstractSqmSelfRenderingFunctionDescriptor
Class Inheritance
Imports
org.hibernate.query.ReturnableType, org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor, org.hibernate.query.sqm.produce.function.StandardArgumentsValidators, .StandardFunctionReturnTypeResolvers, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.SqlAppender, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.type.BasicType, java.util.List

Deprecated

as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated. See corresponding docs for further information.

A "function" with no parameters that returns the current date, time, or timestamp. For example, current_date.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
CurrentFunction(String name, String sql, BasicType<?> type)

Method Summary

Modifier and TypeMethod and Description
public boolean
alwaysIncludesParentheses()

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.alwaysIncludesParentheses.

Will a call to the described function always include parentheses?
public String
public void
Inherited from org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor:
generateSqmAggregateFunctionExpressiongenerateSqmFunctionExpressiongenerateSqmOrderedSetAggregateFunctionExpressiongenerateSqmWindowFunctionExpressiongetFunctionKind

Field Detail

sqlback to summary
private final String sql

Constructor Detail

CurrentFunctionback to summary
public CurrentFunction(String name, String sql, BasicType<?> type)

Method Detail

alwaysIncludesParenthesesback to summary
public boolean alwaysIncludesParentheses()

Overrides default org.hibernate.query.sqm.function.SqmFunctionDescriptor.alwaysIncludesParentheses.

Doc from org.hibernate.query.sqm.function.SqmFunctionDescriptor.alwaysIncludesParentheses.

Will a call to the described function always include parentheses?

Instances of this interface are usually used for rendering of functions. However, there are cases where Hibernate needs to consume a fragment and decide if a token represents a function name. In cases where the token is followed by an opening parenthesis, we can safely assume the token is a function name. Bur if the next token is not an opening parenthesis, the token might still represent a function if the function has a "no paren" form in the case of no arguments.

For example, many databases do not require parentheses for functions like current_timestamp and friends. This method helps account for those cases.

Returns:boolean

true by default

Annotations
@Override
getArgumentListSignatureback to summary
public String getArgumentListSignature()

Overrides org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor.getArgumentListSignature.

Annotations
@Override
renderback to summary
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> arguments, ReturnableType<?> returnType, SqlAstTranslator<?> walker)

Overrides org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor.render.

Implements org.hibernate.query.sqm.function.FunctionRenderer.render.

Annotations
@Override