Interface IBookingRepository
- All Superinterfaces:
IRepository<Booking,
String>
- All Known Implementing Classes:
BookingRepository
Repository interface for accessing and manipulating Booking entities in the
data store.
This interface defines the contract for booking data access operations, including: - Finding bookings by various criteria (ID, applicant, project) - Saving new bookings - Updating existing bookings - Deleting bookings
The repository follows the Repository pattern, abstracting the data access logic from the rest of the application and providing a collection-like interface for booking objects.
-
Method Summary
Modifier and TypeMethodDescriptionfindByApplicantNric
(String applicantNric) Finds all bookings made by a specific applicant.findByApplicationId
(String applicationId) Finds a booking by its associated application ID.Finds a booking by its unique identifier.findByProjectId
(String projectId) Finds all bookings associated with a specific project.Methods inherited from interface com.ntu.fdae.group1.bto.repository.IRepository
findAll, loadAll, save, saveAll
-
Method Details
-
findById
Finds a booking by its unique identifier.- Specified by:
findById
in interfaceIRepository<Booking,
String> - Parameters:
bookingId
- The unique identifier of the booking to retrieve- Returns:
- The booking with the specified ID, or null if not found
-
findByApplicantNric
Finds all bookings made by a specific applicant.- Parameters:
applicantNric
- The NRIC of the applicant- Returns:
- A booking associated with the specified applicant, or null if not found
-
findByApplicationId
Finds a booking by its associated application ID.- Parameters:
applicationId
- The unique identifier of the application- Returns:
- The booking associated with the specified application ID, or null if not found
-
findByProjectId
Finds all bookings associated with a specific project.- Parameters:
projectId
- The unique identifier of the project- Returns:
- A list of bookings for the specified project
-