Package org.hibernate.dialect.function
Class StaticPrecisionFspTimestampFunction
- java.lang.Object
-
- org.hibernate.dialect.function.NoArgSQLFunction
-
- org.hibernate.dialect.function.StaticPrecisionFspTimestampFunction
-
- All Implemented Interfaces:
SQLFunction
public class StaticPrecisionFspTimestampFunction extends NoArgSQLFunction
A function that returns aStandardBasicTypes.TIMESTAMP
with static fractional seconds precision (fsp).
-
-
Constructor Summary
Constructors Constructor Description StaticPrecisionFspTimestampFunction(java.lang.String name, boolean hasParenthesesIfNoArguments)
Constructs aStandardBasicTypes.TIMESTAMP
function using the default fractional second precision as defined by the database.StaticPrecisionFspTimestampFunction(java.lang.String name, int fsp)
Constructs aStandardBasicTypes.TIMESTAMP
function using the specified fractional seconds precision.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
render(Type argumentType, java.util.List args, SessionFactoryImplementor factory)
Render the function call as SQL fragment.-
Methods inherited from class org.hibernate.dialect.function.NoArgSQLFunction
getName, getReturnType, hasArguments, hasParenthesesIfNoArguments
-
-
-
-
Constructor Detail
-
StaticPrecisionFspTimestampFunction
public StaticPrecisionFspTimestampFunction(java.lang.String name, boolean hasParenthesesIfNoArguments)
Constructs aStandardBasicTypes.TIMESTAMP
function using the default fractional second precision as defined by the database.- Parameters:
name
- The function namehasParenthesesIfNoArguments
- Does the function call need parenthesis if there are no arguments?
-
StaticPrecisionFspTimestampFunction
public StaticPrecisionFspTimestampFunction(java.lang.String name, int fsp)
Constructs aStandardBasicTypes.TIMESTAMP
function using the specified fractional seconds precision.- Parameters:
name
- The function namefsp
- The explicit fractional seconds precision to render- Throws:
java.lang.IllegalArgumentException
- iffsp
< 0.
-
-
Method Detail
-
render
public java.lang.String render(Type argumentType, java.util.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 intoSQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)
- Specified by:
render
in interfaceSQLFunction
- Overrides:
render
in classNoArgSQLFunction
- Parameters:
argumentType
- The type of the first argumentargs
- The function argumentsfactory
- The SessionFactory- Returns:
- The rendered function call
- Throws:
QueryException
- Indicates a problem rendering the function call.
-
-