Class UserService

java.lang.Object
com.decs.application.services.UserService

@Service public class UserService extends Object
User Service Class

This class represents a management service for the system's users.

Version:
1.0
Author:
Bruno Guiomar
  • Field Details

  • Constructor Details

    • UserService

      public UserService(UserRepository repository)
      Class Constructor
      Parameters:
      repository - System's user repository
  • Method Details

    • get

      public Optional<User> get(Long id)
      Find and retrieve a User object by its identification number
      Parameters:
      id - User identification number
      Returns:
      Respective user object
    • update

      public User update(User entity)
      Add a user to the repository
      Parameters:
      entity - User to be added
      Returns:
      Added user
    • delete

      public void delete(Long id)
      Delete a user by its identification number
      Parameters:
      id - User identification number
    • list

      public org.springframework.data.domain.Page<User> list(org.springframework.data.domain.Pageable pageable)
    • list

      public org.springframework.data.domain.Page<User> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.jpa.domain.Specification<User> filter)
    • count

      public int count()
      Returns:
      Number of users in the user repository