Interface UserRepository

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

@Repository public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<User,Integer>
This interface is used to interact with the table User. Using JpaRepository we can perform CRUD operations. We can also define custom methods here with querys.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     

    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

    • getUserByUsername

      @Query("SELECT u FROM User u WHERE u.email = :username") User getUserByUsername(@Param("username") String username)
    • findByProjects

      List<User> findByProjects(Project project)
    • findByEmail

      User findByEmail(String email)