Interface OrganizationRepository

All Known Implementing Classes:
OrganizationRepositoryImpl

public interface OrganizationRepository
Repository class for managing Organization entities. Defines methods for CRUD operations and querying subjects.
  • Method Details

    • save

      Organization save(Organization organization)
      Saves a new organization or updates an existing one.
      Parameters:
      organization - the organization to save
      Returns:
      the saved Organization entity
    • existsByName

      boolean existsByName(Organization organization)
      Checks whether an organization with the same name already exists.
      Parameters:
      organization - the organization to check
      Returns:
      true if an organization with the same name exists, otherwise false
    • existsByEmail

      boolean existsByEmail(Organization organization)
      Checks whether an organization with the same email already exists.
      Parameters:
      organization - the organization to check
      Returns:
      true if an organization with the same email exists, otherwise false
    • existsByPhone

      boolean existsByPhone(Organization organization)
      Checks whether an organization with the same phone already exists.
      Parameters:
      organization - the organization to check
      Returns:
      true if an organization with the same phone exists, otherwise false
    • existsById

      boolean existsById(Long id)
      Checks whether an organization with this identifier exists.
      Parameters:
      id - the unique identifier to check
      Returns:
      true if an organization with id exists, otherwise false
    • findById

      Optional<Organization> findById(Long id)
      Retrieves an organization by its unique identifier.
      Parameters:
      id - the unique identifier of the organization
      Returns:
      an Optional containing the organization if fount, otherwise empty
    • findAll

      Page<Organization> findAll(int pageNumber, int pageSize)
      Retrieves a paginated list of organizations.
      Parameters:
      pageNumber - the page number (starting from 0)
      pageSize - the number of organizations per page
      Returns:
      a Page containing the requested organizations
    • update

      void update(Organization organization)
      Updates an existing organization.
      Parameters:
      organization - the organization entity with updated information
    • delete

      void delete(Long id)
      Delete an organization by its unique identifier.
      Parameters:
      id - the unique identifier of the organization to delete