org.hibernate.dialect.function
Class StaticPrecisionFspTimestampFunction

java.lang.Object
  extended by org.hibernate.dialect.function.NoArgSQLFunction
      extended by org.hibernate.dialect.function.StaticPrecisionFspTimestampFunction
All Implemented Interfaces:
SQLFunction

public class StaticPrecisionFspTimestampFunction
extends NoArgSQLFunction

A function that returns a StandardBasicTypes.TIMESTAMP with static fractional seconds precision (fsp).


Constructor Summary
StaticPrecisionFspTimestampFunction(String name, boolean hasParenthesesIfNoArguments)
          Constructs a StandardBasicTypes.TIMESTAMP function using the default fractional second precision as defined by the database.
StaticPrecisionFspTimestampFunction(String name, int fsp)
          Constructs a StandardBasicTypes.TIMESTAMP function using the specified fractional seconds precision.
 
Method Summary
 String render(Type argumentType, List args, SessionFactoryImplementor factory)
          Render the function call as SQL fragment.
 
Methods inherited from class org.hibernate.dialect.function.NoArgSQLFunction
getName, getReturnType, hasArguments, hasParenthesesIfNoArguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticPrecisionFspTimestampFunction

public StaticPrecisionFspTimestampFunction(String name,
                                           boolean hasParenthesesIfNoArguments)
Constructs a StandardBasicTypes.TIMESTAMP function using the default fractional second precision as defined by the database.

Parameters:
name - The function name
hasParenthesesIfNoArguments - Does the function call need parenthesis if there are no arguments?

StaticPrecisionFspTimestampFunction

public StaticPrecisionFspTimestampFunction(String name,
                                           int fsp)
Constructs a StandardBasicTypes.TIMESTAMP function using the specified fractional seconds precision.

Parameters:
name - The function name
fsp - The explicit fractional seconds precision to render
Throws:
IllegalArgumentException - if fsp < 0.
Method Detail

render

public String render(Type argumentType,
                     List args,
                     SessionFactoryImplementor factory)
              throws QueryException
Description copied from interface: SQLFunction
Render the function call as SQL fragment.

Note, the 'firstArgumentType' parameter should match the one passed into SQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)

Specified by:
render in interface SQLFunction
Overrides:
render in class NoArgSQLFunction
Parameters:
argumentType - The type of the first argument
args - The function arguments
factory - The SessionFactory
Returns:
The rendered function call
Throws:
QueryException - Indicates a problem rendering the function call.


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.