Interface Root<X>

Type Parameters:
X - the entity type referenced by the root
All Superinterfaces:
Expression<X>, FetchParent<X,X>, From<X,X>, Path<X>, Selection<X>, TupleElement<X>

public interface Root<X> extends From<X,X>
A root type in the from clause. Query roots always reference entities.
Since:
2.0
  • Method Details

    • getModel

      @Nonnull EntityType<X> getModel()
      Return the metamodel entity corresponding to the root.
      Specified by:
      getModel in interface Path<X>
      Returns:
      metamodel entity corresponding to the root
    • treat

      @Nonnull <T extends X> Root<T> treat(@Nonnull Class<T> type)
      Downcast the root type to the given type.
      Specified by:
      treat in interface From<X,X>
      Specified by:
      treat in interface Path<X>
      Type Parameters:
      T - the subtype of the root type
      Parameters:
      type - a subtype of the root type
      Returns:
      this root downcast to the given type
      Since:
      4.0