Search in sources :

Example 1 with SqmByUnit

use of org.hibernate.query.sqm.tree.expression.SqmByUnit in project hibernate-orm by hibernate.

the class BaseSqmToSqlAstConverter method cleanly.

private <X> X cleanly(Supplier<X> supplier) {
    SqmByUnit byUnit = appliedByUnit;
    Expression timestamp = adjustedTimestamp;
    SqmExpressible<?> timestampType = adjustedTimestampType;
    Expression scale = adjustmentScale;
    boolean negate = negativeAdjustment;
    adjustmentScale = null;
    negativeAdjustment = false;
    appliedByUnit = null;
    adjustedTimestamp = null;
    adjustedTimestampType = null;
    try {
        return supplier.get();
    } finally {
        appliedByUnit = byUnit;
        adjustedTimestamp = timestamp;
        adjustedTimestampType = timestampType;
        adjustmentScale = scale;
        negativeAdjustment = negate;
    }
}
Also used : BinaryArithmeticExpression(org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression) SqmModifiedSubQueryExpression(org.hibernate.query.sqm.tree.expression.SqmModifiedSubQueryExpression) SelfRenderingFunctionSqlAstExpression(org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression) SelfRenderingAggregateFunctionSqlAstExpression(org.hibernate.query.sqm.function.SelfRenderingAggregateFunctionSqlAstExpression) CaseSearchedExpression(org.hibernate.sql.ast.tree.expression.CaseSearchedExpression) SelfRenderingSqlFragmentExpression(org.hibernate.sql.ast.tree.expression.SelfRenderingSqlFragmentExpression) Expression(org.hibernate.sql.ast.tree.expression.Expression) SelfRenderingExpression(org.hibernate.sql.ast.tree.expression.SelfRenderingExpression) SqmExpression(org.hibernate.query.sqm.tree.expression.SqmExpression) CaseSimpleExpression(org.hibernate.sql.ast.tree.expression.CaseSimpleExpression) SqlSelectionExpression(org.hibernate.sql.ast.tree.expression.SqlSelectionExpression) ModifiedSubQueryExpression(org.hibernate.sql.ast.tree.expression.ModifiedSubQueryExpression) SqmByUnit(org.hibernate.query.sqm.tree.expression.SqmByUnit)

Example 2 with SqmByUnit

use of org.hibernate.query.sqm.tree.expression.SqmByUnit in project hibernate-orm by hibernate.

the class BaseSqmToSqlAstConverter method visitByUnit.

@Override
public Object visitByUnit(SqmByUnit byUnit) {
    SqmByUnit outer = appliedByUnit;
    appliedByUnit = byUnit;
    try {
        return byUnit.getDuration().accept(this);
    } finally {
        appliedByUnit = outer;
    }
}
Also used : SqmByUnit(org.hibernate.query.sqm.tree.expression.SqmByUnit)

Aggregations

SqmByUnit (org.hibernate.query.sqm.tree.expression.SqmByUnit)2 SelfRenderingAggregateFunctionSqlAstExpression (org.hibernate.query.sqm.function.SelfRenderingAggregateFunctionSqlAstExpression)1 SelfRenderingFunctionSqlAstExpression (org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression)1 SqmExpression (org.hibernate.query.sqm.tree.expression.SqmExpression)1 SqmModifiedSubQueryExpression (org.hibernate.query.sqm.tree.expression.SqmModifiedSubQueryExpression)1 BinaryArithmeticExpression (org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression)1 CaseSearchedExpression (org.hibernate.sql.ast.tree.expression.CaseSearchedExpression)1 CaseSimpleExpression (org.hibernate.sql.ast.tree.expression.CaseSimpleExpression)1 Expression (org.hibernate.sql.ast.tree.expression.Expression)1 ModifiedSubQueryExpression (org.hibernate.sql.ast.tree.expression.ModifiedSubQueryExpression)1 SelfRenderingExpression (org.hibernate.sql.ast.tree.expression.SelfRenderingExpression)1 SelfRenderingSqlFragmentExpression (org.hibernate.sql.ast.tree.expression.SelfRenderingSqlFragmentExpression)1 SqlSelectionExpression (org.hibernate.sql.ast.tree.expression.SqlSelectionExpression)1