Last active
March 11, 2018 02:58
-
-
Save dhaval201279/f994ad9f57251900523ae62dd0748a4e to your computer and use it in GitHub Desktop.
2nd version of ReservationService - with required collaborator i.e ReservationRepository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.its.reservation.service; | |
import org.springframework.stereotype.Service; | |
import com.its.reservation.repository.Reservation; | |
import com.its.reservation.repository.ReservationRepository; | |
@Service | |
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