Interface ActorRepository

All Superinterfaces:
org.springframework.data.repository.PagingAndSortingRepository<Actor,Long>, org.springframework.data.repository.Repository<Actor,Long>

@Table(name="users") public interface ActorRepository extends org.springframework.data.repository.PagingAndSortingRepository<Actor,Long>
Fetches/saves Actors from/to the users database table.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(@NonNull Actor actor)
    Removes the given Actor from the database table.
    boolean
    existsActorByUserName(@NonNull String userName)
    Checks whether the database contains an Actor with the given Actor.userName.
    @NonNull org.springframework.data.domain.Page<Actor>
    findAll(@NonNull org.springframework.data.domain.Pageable pageable)
    A subset of all Actors in the database table according to the given Pageable.
    @NonNull Optional<Actor>
    findUserByUserName(@NonNull String username)
    Fetches the Actor with the specified user name.
    void
    save(@NonNull Actor actor)
    Stores the given Actor in the database table, possibly replacing an already present Actor with the same Actor.id.

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll
  • Method Details

    • findAll

      @NonNull @NonNull org.springframework.data.domain.Page<Actor> findAll(@NonNull @NonNull org.springframework.data.domain.Pageable pageable)
      A subset of all Actors in the database table according to the given Pageable.
      Specified by:
      findAll in interface org.springframework.data.repository.PagingAndSortingRepository<Actor,Long>
      Parameters:
      pageable - The pagination information specifying which page of Actors shall be returned.
      Returns:
      All actors, but only the specified subset.
    • findUserByUserName

      @NonNull @NonNull Optional<Actor> findUserByUserName(@NonNull @NonNull String username)
      Fetches the Actor with the specified user name.
      Parameters:
      username - The user name whose corresponding Actor shall be returned.
      Returns:
      The Actor associated with the given user name, if it exists.
    • save

      void save(@NonNull @NonNull Actor actor)
      Stores the given Actor in the database table, possibly replacing an already present Actor with the same Actor.id.
      Parameters:
      actor - The Actor that shall be stored permanently.
    • delete

      void delete(@NonNull @NonNull Actor actor)
      Removes the given Actor from the database table.
      Parameters:
      actor - The Actor that shall no longer be stored in the database.
    • existsActorByUserName

      boolean existsActorByUserName(@NonNull @NonNull String userName)
      Checks whether the database contains an Actor with the given Actor.userName.
      Parameters:
      userName - The user name whose presence in the database shall be checked.
      Returns:
      True if an Actor with the user name exists.