# Uses of Class
com.jangular.backend.models.User

Packages that use User
Package
Description
com.jangular.backend.dto
com.jangular.backend.repository
com.jangular.backend.security
com.jangular.backend.service

## Uses of User in com.jangular.backend.dto

Constructors in com.jangular.backend.dto with parameters of type User
Modifier
Constructor
Description
``
`UserDTO(User user)`

## Uses of User in com.jangular.backend.repository

Methods in com.jangular.backend.repository that return types with arguments of type User
Modifier and Type
Method
Description
`Optional<User>`
UserRepository.`findByEmailAndIsDeletedFalse(String email)`
`Optional<User>`
UserRepository.`findByIdAndIsDeletedFalse(Long id)`
`List<User>`
UserRepository.`findByIsActiveAndIsDeletedFalse(boolean isActive)`
`Optional<User>`
UserRepository.`findByUsername(String username)`
`Optional<User>`
UserRepository.`findByUsernameAndIsDeletedFalse(String username)`
`Optional<User>`
UserRepository.`findByUsernameAndIsDeletedFalseAndIsActive(String username, boolean isActive)`
Methods in com.jangular.backend.repository with parameters of type User
Modifier and Type
Method
Description
`void`
RefreshTokenRepository.`deleteByUser(User user)`
`Optional<RefreshToken>`
RefreshTokenRepository.`findByUser(User user)`
`List<PasswordHistory>`
PasswordHistoryRepository.`findTop5ByUserOrderByChangedAtDesc(User user)`

## Uses of User in com.jangular.backend.security

Methods in com.jangular.backend.security with parameters of type User
Modifier and Type
Method
Description
`static UserPrincipal`
UserPrincipal.`create(User user)`

## Uses of User in com.jangular.backend.service

Methods in com.jangular.backend.service that return User
Modifier and Type
Method
Description
`User`
UserService.`addRoleToUser(Long userId, RoleName roleName)`
Add role to user
`User`
UserService.`createUser(User user)`
Creates a new user with encoded password and default USER role
`User`
UserService.`removeRoleFromUser(Long userId, RoleName roleName)`
Remove role from user
`User`
UserService.`updateUser(User user)`
Updates a user's information
Methods in com.jangular.backend.service that return types with arguments of type User
Modifier and Type
Method
Description
`List<User>`
UserService.`findAllActiveUsers()`
Get all active users
`Optional<User>`
UserService.`findByEmail(String email)`
Find user by email
`Optional<User>`
UserService.`findById(Long id)`
Find user by ID
`Optional<User>`
UserService.`findByUsername(String username)`
Find user by username
Methods in com.jangular.backend.service with parameters of type User
Modifier and Type
Method
Description
`User`
UserService.`createUser(User user)`
Creates a new user with encoded password and default USER role
`User`
UserService.`updateUser(User user)`
Updates a user's information