Interface UserRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<User,String>, org.springframework.data.jpa.repository.JpaRepository<User,String>, org.springframework.data.repository.ListCrudRepository<User,String>, org.springframework.data.repository.ListPagingAndSortingRepository<User,String>, org.springframework.data.repository.PagingAndSortingRepository<User,String>, org.springframework.data.repository.query.QueryByExampleExecutor<User>, org.springframework.data.repository.Repository<User,String>

public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<User,String>
Data Access Object for the User class
Author:
Dr. Thomas Bassler *
  • Method Summary

    Modifier and Type
    Method
    Description
    Get all user accounts having the given authority (as directly assigned authority)
    Get all user accounts whose expiration date is reached before the given limit date
    Get all users for the given mission
    Get the user with the given user name

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

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

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

    findAll, findAllById, saveAll

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

    findAll

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

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByUsername

      User findByUsername(String username)
      Get the user with the given user name
      Parameters:
      username - the user name
      Returns:
      the unique processing user identified by the given user name
    • findByMissionCode

      @Query("select u from users u where u.username like concat(?1, \'-%\')") List<User> findByMissionCode(String missionCode)
      Get all users for the given mission
      Parameters:
      missionCode - the code of the mission
      Returns:
      a list of users with user names starting with the mission code
    • findByExpirationDateBefore

      List<User> findByExpirationDateBefore(Date expirationLimit)
      Get all user accounts whose expiration date is reached before the given limit date
      Parameters:
      expirationLimit - limit date for account expirations
      Returns:
      a list of user accounts expired before the given limit
    • findByAuthority

      @Query("select u from users u join u.authorities a where a.authority = ?1") List<User> findByAuthority(String authority)
      Get all user accounts having the given authority (as directly assigned authority)
      Parameters:
      authority - the authority (name) to check for
      Returns:
      a list of user accounts with the given authority