Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
2nd version of ReservationService - with required collaborator i.e ReservationRepository
package com.its.reservation.service;
import org.springframework.stereotype.Service;
import com.its.reservation.repository.Reservation;
import com.its.reservation.repository.ReservationRepository;
public class ReservationService {
private ReservationRepository reservationRepository;
public ReservationService(ReservationRepository reservationRepository) {
this.reservationRepository = reservationRepository;
public Reservation getReservationDetails(String name) {
return reservationRepository.findByFirstName(name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment