Skip to content

Instantly share code, notes, and snippets.

@dhaval201279
Last active March 11, 2018 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhaval201279/f994ad9f57251900523ae62dd0748a4e to your computer and use it in GitHub Desktop.
Save dhaval201279/f994ad9f57251900523ae62dd0748a4e to your computer and use it in GitHub Desktop.
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;
@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