001 // Copyright 2009 by Basil Vandegriend. All rights reserved.
002
003 package com.basilv.examples.spring.componentscan;
004
005 import org.springframework.beans.factory.annotation.Autowired;
006 import org.springframework.stereotype.Service;
007
008 import com.basilv.examples.spring.*;
009
010 @Service
011 public 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 }