Search in sources :

Example 1 with IntervalType

use of org.hibernate.query.sqm.IntervalType in project hibernate-orm by hibernate.

the class TimestampaddFunction method patternRenderer.

PatternRenderer patternRenderer(TemporalUnit unit, Expression interval, Expression to) {
    TemporalType temporalType = getSqlTemporalType(to.getExpressionType());
    IntervalType intervalType = getSqlIntervalType(interval.getExpressionType().getJdbcMappings().get(0));
    return new PatternRenderer(dialect.timestampaddPattern(unit, temporalType, intervalType));
}
Also used : IntervalType(org.hibernate.query.sqm.IntervalType) TypeConfiguration.getSqlIntervalType(org.hibernate.type.spi.TypeConfiguration.getSqlIntervalType) PatternRenderer(org.hibernate.query.sqm.produce.function.internal.PatternRenderer) TemporalType(jakarta.persistence.TemporalType) TypeConfiguration.getSqlTemporalType(org.hibernate.type.spi.TypeConfiguration.getSqlTemporalType)

Aggregations

TemporalType (jakarta.persistence.TemporalType)1 IntervalType (org.hibernate.query.sqm.IntervalType)1 PatternRenderer (org.hibernate.query.sqm.produce.function.internal.PatternRenderer)1 TypeConfiguration.getSqlIntervalType (org.hibernate.type.spi.TypeConfiguration.getSqlIntervalType)1 TypeConfiguration.getSqlTemporalType (org.hibernate.type.spi.TypeConfiguration.getSqlTemporalType)1