JPA Method
in jakarta.persistence.criteria.Expression

Expression<X> as(
  Class<X> type
)


Perform a typecast upon the expression, returning a new expression object. Unlike cast(), this method does not cause type conversion: the runtime type is not changed.

Warning: may result in a runtime failure.

Parameters:
type - intended type of the expression
Return:
new expression of the given type
See Also:
cast()
Since:
JPA 2.0