Package de.dlr.proseo.usermgr.dao
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 TypeMethodDescriptionfindByAuthority(String authority) Get all user accounts having the given authority (as directly assigned authority)findByExpirationDateBefore(Date expirationLimit) Get all user accounts whose expiration date is reached before the given limit datefindByMissionCode(String missionCode) Get all users for the given missionfindByUsername(String username) Get the user with the given user nameMethods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByUsername
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
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
-