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.TIMESTAMPwith static fractional seconds precision (fsp).
-
-
Constructor Summary
Constructors Constructor Description StaticPrecisionFspTimestampFunction(String name, boolean hasParenthesesIfNoArguments)Constructs aStandardBasicTypes.TIMESTAMPfunction using the default fractional second precision as defined by the database.StaticPrecisionFspTimestampFunction(String name, int fsp)Constructs aStandardBasicTypes.TIMESTAMPfunction using the specified fractional seconds precision.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringrender(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
-
-
-
-
Constructor Detail
-
StaticPrecisionFspTimestampFunction
public StaticPrecisionFspTimestampFunction(String name, boolean hasParenthesesIfNoArguments)
Constructs aStandardBasicTypes.TIMESTAMPfunction 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(String name, int fsp)
Constructs aStandardBasicTypes.TIMESTAMPfunction using the specified fractional seconds precision.- Parameters:
name- The function namefsp- The explicit fractional seconds precision to render- Throws:
IllegalArgumentException- iffsp< 0.
-
-
Method Detail
-
render
public String render(Type argumentType, List args, SessionFactoryImplementor factory) throws QueryException
Description copied from interface: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)- Specified by:
renderin interfaceSQLFunction- Overrides:
renderin 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.
-
-