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

public Class StaticPrecisionFspTimestampFunction

extends NoArgSQLFunction
Class Inheritance
Imports
java.util.List, org.hibernate.QueryException, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.type.StandardBasicTypes, .Type

A function that returns a org.hibernate.type.StandardBasicTypes#TIMESTAMP with static fractional seconds precision (fsp).
Author
Gail Badner

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
StaticPrecisionFspTimestampFunction(String
The function name
name
,
boolean
Does the function call need parenthesis if there are no arguments?
hasParenthesesIfNoArguments
)

Constructs a org.hibernate.type.StandardBasicTypes#TIMESTAMP function using the default fractional second precision as defined by the database.

public
StaticPrecisionFspTimestampFunction(String
The function name
name
,
int
The explicit fractional seconds precision to render
fsp
)

Constructs a org.hibernate.type.StandardBasicTypes#TIMESTAMP function using the specified fractional seconds precision.

Method Summary

Modifier and TypeMethod and Description
public String
render(Type
The type of the first argument
argumentType
,
List<E>
The function arguments
args
,
SessionFactoryImplementor
The SessionFactory
factory
)

Overrides org.hibernate.dialect.function.NoArgSQLFunction.render.

Implements org.hibernate.dialect.function.SQLFunction.render.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Render the function call as SQL fragment.
Inherited from org.hibernate.dialect.function.NoArgSQLFunction:
getNamegetReturnTypehasArgumentshasParenthesesIfNoArguments

Field Detail

renderedStringback to summary
private final String renderedString

Constructor Detail

StaticPrecisionFspTimestampFunctionback to summary
public StaticPrecisionFspTimestampFunction(String name, boolean hasParenthesesIfNoArguments)

Constructs a org.hibernate.type.StandardBasicTypes#TIMESTAMP function using the default fractional second precision as defined by the database.

Parameters
name:String

The function name

hasParenthesesIfNoArguments:boolean

Does the function call need parenthesis if there are no arguments?

StaticPrecisionFspTimestampFunctionback to summary
public StaticPrecisionFspTimestampFunction(String name, int fsp)

Constructs a org.hibernate.type.StandardBasicTypes#TIMESTAMP function using the specified fractional seconds precision.

Parameters
name:String

The function name

fsp:int

The explicit fractional seconds precision to render

Exceptions
IllegalArgumentException:
if fsp < 0.

Method Detail

renderback to summary
public String render(Type argumentType, List<E> args, SessionFactoryImplementor factory) throws QueryException

Overrides org.hibernate.dialect.function.NoArgSQLFunction.render.

Implements org.hibernate.dialect.function.SQLFunction.render.

Doc from org.hibernate.dialect.function.SQLFunction.render.

Deprecated

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

Render the function call as SQL fragment.

Note, the 'firstArgumentType' parameter should match the one passed into getReturnType

Parameters
argumentType:Type

The type of the first argument

args:List<E>

The function arguments

factory:SessionFactoryImplementor

The SessionFactory

Returns:String

The rendered function call

Annotations
@Override
Exceptions
QueryException:
Indicates a problem rendering the function call.