title: Is JPARepository interface covers the responsibilities of DAO interface in Spring Boot?
body: <p>I'm new to Spring Boot and I have a question. I will present it as this. </p>
  
  <p>DAO is a design pattern and It has three components. Those are </p>
  
  <ol>
  <li>DAO interface - use to declare methods that need to perform on DTO</li>
  <li>DAO interface implementation -use to take data from data source(database)</li>
  <li>DTO(Data Transfer Object) - use to retain data to transport among layers.</li>
  </ol>
  
  <p>For example, If we get Student.</p>
  
  <p><strong>Student.java (DTO)</strong></p>
  
  <pre><code>public class Student {
      private String name;
      private int rollNo;
  
      Student(String name, int rollNo) {
          this.name = name;
          this.rollNo = rollNo;
      }
  
      //getters and setters
  }
  </code></pre>
  
  <p><strong>StudentDao.java</strong></p>
  
  <pre><code>import java.util.List;
  
  public interface StudentDao {
      public List&lt;Student&gt; getAllStudents();
      public Student getStudent(int rollNo);
      public void updateStudent(Student student);
      public void deleteStudent(Student student);
  }
  </code></pre>
  
  <p><strong>StudentDaoImpl.java</strong></p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  public class StudentDaoImpl implements StudentDao {
  
      //list is working as a database
      List&lt;Student&gt; students;
  
      public StudentDaoImpl(){
          students = new ArrayList&lt;Student&gt;();
          Student student1 = new Student("Robert",0);
          Student student2 = new Student("John",1);
          students.add(student1);
          students.add(student2);
      }
      @Override
      public void deleteStudent(Student student) {
          students.remove(student.getRollNo());
          System.out.println("Student: Roll No " + student.getRollNo() + ", deleted from database");
      }
  
      //retrive list of students from the database
      @Override
      public List&lt;Student&gt; getAllStudents() {
          return students;
      }
  
      @Override
      public Student getStudent(int rollNo) {
          return students.get(rollNo);
      }
  
      @Override
      public void updateStudent(Student student) {
          students.get(student.getRollNo()).setName(student.getName());
          System.out.println("Student: Roll No " + student.getRollNo() + ", updated in the database");
      }
  }
  </code></pre>
  
  <p>It is about the DAO. In spring boot, there is <code>JPARepository</code> interface. This interface has been declare the methods such as <code>save(), findById()</code>. and we can use the <code>JPARepository</code> as follows.</p>
  
  <pre><code>@Repository
  public interface StudentRepository extends JpaRepository&lt;Student, Integer&gt; {
  
  }
  </code></pre>
  
  <p>Then after we can use this interface the <code>Controller</code> class.</p>
  
  <p><strong>SoftwareEngineerController.java</strong></p>
  
  <pre><code>@RestController
  @RequestMapping(value = "student")
  public class SoftwareEngineerController {
      @Autowired
      StudentRepository studentRepository;
  
      //to retrieve all software engineers
      @GetMapping("/students")
      public List&lt;Studentr&gt; getAllEngineers(){
          return studentRepository.findAll();
  }
  </code></pre>
  
  <p>I feel that the <code>JPARepository</code> interface and the <code>DAO</code> interface are doing the same task. (declare the essential methods are needed to perform to dealing with the data)Spring boot is containing the <code>JPARepository</code> hence no more need the DAO is inside the spring boot applications. Is it true?. I'm new to spring boot so if you can give me a good explanation I will highly appreciate it.  </p>