Class AbstractWindowFunction
- java.lang.Object
-
- com.blazebit.persistence.impl.function.window.AbstractWindowFunction
-
- All Implemented Interfaces:
com.blazebit.persistence.spi.JpqlFunction
- Direct Known Subclasses:
AbstractGroupConcatWindowFunction,AvgFunction,CountFunction,CumeDistFunction,DenseRankFunction,FirstValueFunction,LagFunction,LastValueFunction,LeadFunction,MaxFunction,MinFunction,NthValueFunction,NtileFunction,PercentRankFunction,RankFunction,RowNumberFunction,SumFunction,WindowEveryFunction,WindowOrAggFunction
public abstract class AbstractWindowFunction extends Object implements com.blazebit.persistence.spi.JpqlFunction
See the following for details: https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS- Since:
- 1.4.0
- Author:
- Jan-Willem Gmelig Meyling, Sayra Ranjha
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractWindowFunction.WindowFunction
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowsFilterClauseprotected StringfunctionNameprotected booleannullIsSmallestprotected booleansupportsFilterClauseprotected booleansupportsNullPrecedence
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWindowFunction(String functionName, boolean nullIsSmallest, boolean supportsNullPrecedence, boolean supportsFilterClause, boolean allowsFilterClause)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendEmulatedOrderByElementWithNulls(com.blazebit.persistence.spi.FunctionRenderContext context, Order element)protected static StringgetCaseWhenPost()protected static StringgetCaseWhenPre(List<String> filterExpressions)Class<?>getReturnType(Class<?> firstArgumentType)protected AbstractWindowFunction.WindowFunctiongetWindowFunction(com.blazebit.persistence.spi.FunctionRenderContext context)protected <T extends AbstractWindowFunction.WindowFunction>
TgetWindowFunction(com.blazebit.persistence.spi.FunctionRenderContext context, T function, int startIndex)booleanhasArguments()booleanhasParenthesesIfNoArguments()protected booleanoptimizeNullPrecedence()protected Enum<?>processArgument(Enum<?> mode, AbstractWindowFunction.WindowFunction windowFunction, String argument)voidrender(com.blazebit.persistence.spi.FunctionRenderContext context)protected voidrender(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)protected voidrenderArgument(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction, String caseWhenPre, String caseWhenPost, String argument, int argumentIndex)protected voidrenderArguments(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)protected voidrenderFilterExpressions(com.blazebit.persistence.spi.FunctionRenderContext context, List<String> filterExpressions)protected voidrenderFrame(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)protected voidrenderFramePosition(com.blazebit.persistence.spi.FunctionRenderContext context, com.blazebit.persistence.parser.expression.WindowFramePositionType type, String frameExpression)protected voidrenderFunction(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)protected voidrenderOrder(com.blazebit.persistence.spi.FunctionRenderContext context, Order order)protected voidrenderOrderBy(com.blazebit.persistence.spi.FunctionRenderContext context, List<Order> orderBys)protected voidrenderPartitions(com.blazebit.persistence.spi.FunctionRenderContext context, List<String> partitionExpressions)protected booleanrequiresOver()
-
-
-
Field Detail
-
functionName
protected final String functionName
-
nullIsSmallest
protected final boolean nullIsSmallest
-
supportsNullPrecedence
protected final boolean supportsNullPrecedence
-
supportsFilterClause
protected final boolean supportsFilterClause
-
allowsFilterClause
protected final boolean allowsFilterClause
-
-
Constructor Detail
-
AbstractWindowFunction
protected AbstractWindowFunction(String functionName, boolean nullIsSmallest, boolean supportsNullPrecedence, boolean supportsFilterClause, boolean allowsFilterClause)
-
-
Method Detail
-
hasArguments
public boolean hasArguments()
- Specified by:
hasArgumentsin interfacecom.blazebit.persistence.spi.JpqlFunction
-
hasParenthesesIfNoArguments
public boolean hasParenthesesIfNoArguments()
- Specified by:
hasParenthesesIfNoArgumentsin interfacecom.blazebit.persistence.spi.JpqlFunction
-
getReturnType
public Class<?> getReturnType(Class<?> firstArgumentType)
- Specified by:
getReturnTypein interfacecom.blazebit.persistence.spi.JpqlFunction
-
render
public final void render(com.blazebit.persistence.spi.FunctionRenderContext context)
- Specified by:
renderin interfacecom.blazebit.persistence.spi.JpqlFunction
-
getWindowFunction
protected AbstractWindowFunction.WindowFunction getWindowFunction(com.blazebit.persistence.spi.FunctionRenderContext context)
-
getWindowFunction
protected <T extends AbstractWindowFunction.WindowFunction> T getWindowFunction(com.blazebit.persistence.spi.FunctionRenderContext context, T function, int startIndex)
-
processArgument
protected Enum<?> processArgument(Enum<?> mode, AbstractWindowFunction.WindowFunction windowFunction, String argument)
-
requiresOver
protected boolean requiresOver()
-
render
protected void render(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)
-
renderFunction
protected void renderFunction(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)
-
renderArguments
protected void renderArguments(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)
-
getCaseWhenPost
protected static String getCaseWhenPost()
-
renderArgument
protected void renderArgument(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction, String caseWhenPre, String caseWhenPost, String argument, int argumentIndex)
-
renderFilterExpressions
protected void renderFilterExpressions(com.blazebit.persistence.spi.FunctionRenderContext context, List<String> filterExpressions)
-
renderPartitions
protected void renderPartitions(com.blazebit.persistence.spi.FunctionRenderContext context, List<String> partitionExpressions)
-
renderOrderBy
protected void renderOrderBy(com.blazebit.persistence.spi.FunctionRenderContext context, List<Order> orderBys)
-
renderOrder
protected void renderOrder(com.blazebit.persistence.spi.FunctionRenderContext context, Order order)
-
renderFrame
protected void renderFrame(com.blazebit.persistence.spi.FunctionRenderContext context, AbstractWindowFunction.WindowFunction windowFunction)
-
renderFramePosition
protected void renderFramePosition(com.blazebit.persistence.spi.FunctionRenderContext context, com.blazebit.persistence.parser.expression.WindowFramePositionType type, String frameExpression)
-
optimizeNullPrecedence
protected boolean optimizeNullPrecedence()
-
appendEmulatedOrderByElementWithNulls
protected void appendEmulatedOrderByElementWithNulls(com.blazebit.persistence.spi.FunctionRenderContext context, Order element)
-
-