Repository Pattern
Learn Repository Pattern (Spring MVC Architecture & Design Patterns, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes Repository : a collection-like abstraction that hides how domain objects are stored and loaded, so services work with objects, not SQL. In Spring : annotate an interface or class with @Repository ; Spring Data generates the implementation from JpaRepository . Purpose : one place for persistence code, easy to mock in tests and to swap databases.