Jakarta Persistence (JPA) Method

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


Perform a typecast upon the expression, returning a new expression object. Unlike Expression.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
Returns:
new expression of the given type.
See Also:
Since:
Jakarta Persistence (JPA) 1.0