Leave a Reply

9 Comments on "Spring Boot Quick Start 28 – Creating a Spring Data JPA Repository"

Notify of
avatar

Vijay Anand Mehta
Guest
Vijay Anand Mehta
3 days 23 hours ago

may be a silly question but….the annotation you are using are provide by whom…Spring MVC?Please do replythank you

Neeraj Kashyap
Guest
Neeraj Kashyap
12 days 10 hours ago

What if I am having composite ID in an Entity, and also many different type of entities to be persisted. Do I need to create that many number of interfaces ?

Mac New
Guest
Mac New
13 days 13 hours ago

Field topicRepository in io.javabrains.springbootquickstart.topic.TopicService required a bean of type 'io.javabrains.springbootquickstart.topic.TopicRepository' that could not be found. problem

Saurav Raj
Guest
Saurav Raj
1 month 1 day ago

very well explained. Good effort.Appreciated.Thanks !!

G. VAIBHAV REDDY
Guest
G. VAIBHAV REDDY
1 month 17 days ago

Here's the dependency we need to add to pom.xml if you are not seeing this import "javax.persistence.Entity"<!– mvnrepository.com/artifact/org.springframework.data/spring-data-jpa –> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency>

Skullid13
Guest
Skullid13
2 months 16 days ago

Thank you Rajesh, great video

venu chary
Guest
venu chary
4 months 23 days ago

Hey KoushikYour tutorials are awesome. I have this one doubt. You said CrudRepository is a class and declared TopicRepository as an interface. In Java an interface cann't extend a class right?

h s
Guest
h s
1 month 25 days ago

crudRepository is an Interface, and in Java an Interface can extend another Interface, not "implements"

luv2bwith
Guest
luv2bwith
4 months 23 days ago
CrudRepository is not a class,its an interface. There are a number of such interfaces provided by Spring Data JPA module viz. JPARepository, PagingAndSortingRepository, CrudRepository. The choice of repository depends upon the type of database you need to connect to.As for example,if you are connecting to MongoDB, you would use CrudRepository since PagingAndSortingRepository is difficult to implement in a MongoDB.The actual implementation for these repositories is abstracted by Spring Data JPA. You can create your own interface that extends any of these above Repository Interfaces and then implement that interface in any class of your own to provide additional or custom… Read more »
wpDiscuz