Top Description Fields Constructors Methods
org.hibernate.query.sqm.tree.expression

public Class Conversion

extends Object
implements Expression, DomainResultProducer
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.sql.ast.tree.expression.Expression, org.hibernate.sql.ast.spi.SqlSelectionProducer, org.hibernate.sql.ast.tree.SqlAstNode
Imports
org.hibernate.metamodel.mapping.BasicValuedMapping, .MappingModelExpressible, org.hibernate.query.sqm.TemporalUnit, org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.sql.ast.SqlAstWalker, org.hibernate.sql.ast.spi.SqlAstCreationState, .SqlExpressionResolver, org.hibernate.sql.ast.tree.expression.Duration, .Expression, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, org.hibernate.sql.results.graph.basic.BasicResult

A conversion of a duration to a given temporal unit, as a result of applying the 'by unit' operator.
Author
Gavin King
See Also
which does the opposite

Field Summary

Modifier and TypeField and Description
private final Duration
private final BasicValuedMapping
private final TemporalUnit

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
applySqlSelections(DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used when this producer is a selection in a sub-query.
public DomainResult<J>
public Duration
public MappingModelExpressible<T>
public TemporalUnit
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

durationback to summary
private final Duration duration
typeback to summary
private final BasicValuedMapping type
unitback to summary
private final TemporalUnit unit

Constructor Detail

Conversionback to summary
public Conversion(Duration duration, TemporalUnit unit, BasicValuedMapping type)

Method Detail

acceptback to summary
public void accept(SqlAstWalker walker)

Implements org.hibernate.sql.ast.tree.SqlAstNode.accept.

Annotations
@Override
applySqlSelectionsback to summary
public void applySqlSelections(DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used when this producer is a selection in a sub-query. The DomainResult is only needed for root query of a SELECT statement. This default impl assumes this producer is a true (Sql)Expression

Annotations
@Override
createDomainResultback to summary
public DomainResult<J> createDomainResult(String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Produce the domain query

Annotations
@Override
getDurationback to summary
public Duration getDuration()
getExpressionTypeback to summary
public MappingModelExpressible<T> getExpressionType()

Implements org.hibernate.sql.ast.tree.expression.Expression.getExpressionType.

Doc from org.hibernate.sql.ast.tree.expression.Expression.getExpressionType.

The type for this expression

Annotations
@Override
getUnitback to summary
public TemporalUnit getUnit()