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;
}
}
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;
}
}
Aggregations