Interface RecruiterRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Recruiter,String>, org.springframework.data.repository.ListCrudRepository<Recruiter,String>, org.springframework.data.repository.ListPagingAndSortingRepository<Recruiter,String>, org.springframework.data.mongodb.repository.MongoRepository<Recruiter,String>, org.springframework.data.repository.PagingAndSortingRepository<Recruiter,String>, org.springframework.data.repository.query.QueryByExampleExecutor<Recruiter>, org.springframework.data.repository.Repository<Recruiter,String>

@Repository public interface RecruiterRepository extends org.springframework.data.mongodb.repository.MongoRepository<Recruiter,String>
Repository interface for accessing and manipulating Recruiter documents in MongoDB.

This repository provides methods for CRUD operations on Recruiter entities, as well as custom queries for retrieving recruiters based on various criteria such as user ID, company name, company size, verification status, and location. It leverages Spring Data MongoDB's query method naming conventions for defining custom finder methods.

As a Spring Data repository, it automatically provides standard operations like:

  • Saving and updating recruiter profiles
  • Deleting recruiter profiles
  • Finding recruiter profiles by ID
  • Retrieving all recruiter profiles

The interface also defines custom queries needed for specific business operations in the application, particularly for linking User accounts to Recruiter profiles and for company-specific queries.

Since:
2025-05-15
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if a recruiter profile exists for a specific user.
    Finds recruiter profiles by exact company name.
    Finds recruiter profiles by partial company name (case-insensitive).
    Finds recruiter profiles by company size category.
    Finds recruiter profiles by verification status.
    Finds recruiter profiles by partial location (case-insensitive).
    Finds a recruiter profile by its associated user ID.

    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.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.mongodb.repository.MongoRepository

    findAll, findAll, insert, insert

    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

    • findByUserId

      Optional<Recruiter> findByUserId(String userId)
      Finds a recruiter profile by its associated user ID. This method is used to retrieve the profile for a specific user account.
      Parameters:
      userId - the ID of the user account
      Returns:
      an Optional containing the recruiter profile if found, or empty if not
    • findByCompanyName

      List<Recruiter> findByCompanyName(String companyName)
      Finds recruiter profiles by exact company name.
      Parameters:
      companyName - the exact company name to match
      Returns:
      a list of recruiter profiles from the specified company
    • findByCompanyNameContainingIgnoreCase

      List<Recruiter> findByCompanyNameContainingIgnoreCase(String companyName)
      Finds recruiter profiles by partial company name (case-insensitive). This is useful for searching and filtering recruiters by company.
      Parameters:
      companyName - the partial company name to search for
      Returns:
      a list of recruiter profiles matching the search criteria
    • existsByUserId

      boolean existsByUserId(String userId)
      Checks if a recruiter profile exists for a specific user. This is useful during profile creation to prevent duplicates.
      Parameters:
      userId - the ID of the user account
      Returns:
      true if a profile exists, false otherwise
    • findByCompanySize

      List<Recruiter> findByCompanySize(String companySize)
      Finds recruiter profiles by company size category.
      Parameters:
      companySize - the company size category (e.g., STARTUP, SMALL, MEDIUM, LARGE, ENTERPRISE)
      Returns:
      a list of recruiter profiles matching the company size
    • findByIsVerified

      List<Recruiter> findByIsVerified(Boolean isVerified)
      Finds recruiter profiles by verification status. This is used to filter verified vs. unverified recruiters.
      Parameters:
      isVerified - true to find verified recruiters, false to find unverified recruiters
      Returns:
      a list of recruiter profiles matching the verification status
    • findByLocationContainingIgnoreCase

      List<Recruiter> findByLocationContainingIgnoreCase(String location)
      Finds recruiter profiles by partial location (case-insensitive). This is useful for geographic filtering of recruiters.
      Parameters:
      location - the partial location to search for
      Returns:
      a list of recruiter profiles matching the location search