001// Copyright 2009 by Basil Vandegriend. All rights reserved. 002 003package com.basilv.examples.spring.componentscan; 004 005import org.springframework.beans.factory.annotation.Autowired; 006import org.springframework.stereotype.Service; 007 008import com.basilv.examples.spring.*; 009 010@Service 011public class CalculatorServiceImpl implements CalculatorService 012{ 013 private ResumeRepository resumeRepository; 014 015 @Autowired 016 public CalculatorServiceImpl(ResumeRepository resumeRepository) { 017 super(); 018 this.resumeRepository = resumeRepository; 019 } 020 021 public boolean validate(Resume resume) { 022 for (Resume repoResume : resumeRepository.findAll()) { 023 if (repoResume.getName().equals(resume.getName())) { 024 return true; 025 } 026 } 027 028 return false; 029 } 030 031}