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 TypeMethodDescriptionbooleanexistsByUserId(String userId) Checks if a recruiter profile exists for a specific user.findByCompanyName(String companyName) Finds recruiter profiles by exact company name.findByCompanyNameContainingIgnoreCase(String companyName) Finds recruiter profiles by partial company name (case-insensitive).findByCompanySize(String companySize) Finds recruiter profiles by company size category.findByIsVerified(Boolean isVerified) Finds recruiter profiles by verification status.findByLocationContainingIgnoreCase(String location) Finds recruiter profiles by partial location (case-insensitive).findByUserId(String userId) 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, saveMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.mongodb.repository.MongoRepository
findAll, findAll, insert, insertMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByUserId
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
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
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
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
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
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
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
-