Access the full course here: javabrains.io/courses/spring_bootquickstart
Understandn and use basic CRUD operations directly on the database using the methods provided by CrudRepository.
57 Comments on "Spring Boot Quick Start 29 – Making Crud Operations with Repository"
Please help me to resolve this:
Field topicRepository in io.springbootquickstart.topic.TopicService required a bean of type 'io.springbootquickstart.topic.TopicRepository' that could not be found.
Consider defining a bean of type 'io.springbootquickstart.topic.TopicRepository' in your configuration.
Used the following annotations:
@SpringBootApplication@ComponentScan("com.stsproject")@EnableJpaRepositories("io.springbootquickstart.topic")@EntityScan(basePackages = "io.springbootquickstart.topic")
Can you use the CrudRepository interface with Hibernate? Would you need a SessionFactory if you have a CrudRepository implementation?Thank you for these great tutorials.
help me! i got this error Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:179) at com.example.demo.CourseApiData2Application.main(CourseApiDataApplication.java:10)
Thanks for the amazing tutorials. BTW, You can ideally override findAll method with return type as List<Topic> in TopicRepository. Just add the following code and it will work like charm.@Override public List<Topic> findAll();
This is so amazing that I could not even believe that I could start writing spring boot apps this easily. But one problem I am facing is that whenever I stop and restart the application all the data I had stored using post request into my embedded database just disappears and I have to post data again. And I kinda recall that you said you will do some tutorials about connecting the external database ( non volatile /persistence database). I would love it so much if you could do some videos on that .. Thanks in advance sir 🙂
i didn't get the part where you instantiate an interface and autowire it?
arg.. You never showed the controller.
I do my app in eclipse and without saving all my changes I have got the same error as your((((Just always press Save button in eclipse ide!
Can you please tell me how dependency is injected in TopicRepository ? which class object will get injected in variable topicRepository ?
If you use IntelliJ, you might encounter a problem where topicRepository is not autowired. It's actually autowired,but IntelliJ doesn't recognize that. If you add Spring Data plugin in plugins, it will not show any errors.
In CodeChannels.com, you can learn to code by watching videos and stay up to date with latest code shows, events and tutorials aggregated from various leading developer communities.
Copyright 2016 By CodeChannels.com All rights reserved.