Chapter 8. Serving a good cause - Repository

That was the first method to add to the brand new repository. So we created a repository for the application, annotated it with @Repository and @Transactional. We did the same for the Actor.

@Repository @Transactional
public class CineastsRepostory {
  FinderFactory finderFactory;
  Finder<Movie> movieFinder;
  @Autowired
  public CineastsRepostory(FinderFactory finderFactory) {
      this.finderFactory = finderFactory;
      this.movieFinder = finderFactory.createNodeEntityFinder(Movie.class);
  }
  public Movie getMovie(int id) {
      return movieFinder.findByPropertyValue(null,"id", id);
  }
}