Leave a Reply

75 Comments on "Spring Boot Quick Start 29 – Making Crud Operations with Repository"

Notify of
avatar

surya m
Guest
surya m
4 days 22 hours ago

Hi Kowshik , can we use like this? without iterating and addingpublic List<Items> getAllaitems(){ return (List<Items>) itemsRepository.findAll(); }

Guram Kankava
Guest
Guram Kankava
12 days 51 minutes ago

Thank you very much.

Tarık Nural
Guest
Tarık Nural
13 days 1 hour ago
For the people who wants to connect a real database I created a configuration file for a database called "test" configure for yourself.# ===============================# = DATA SOURCE# ===============================# Set here configurations for the database connection# Connection url for the database "test"spring.datasource.url = jdbc: Username and passwordspring.datasource.username = rootspring.datasource.password = # Keep the connection alive if idle for a long time (needed in production)spring.datasource.testWhileIdle = truespring.datasource.validationQuery = SELECT 1# ===============================# = JPA / HIBERNATE# ===============================# Use spring.jpa.properties.* for Hibernate native properties (the prefix is# stripped before adding them to the entity manager).# Show or not log for each sql queryspring.jpa.show-sql =… Read more »
Dharashan Sithamparam
Guest
Dharashan Sithamparam
24 days 17 hours ago

Your always … great

Dadi del
Guest
Dadi del
30 days 8 minutes ago

Thanks a lot Koushik! you're amazing!

Vivek Naskar
Guest
Vivek Naskar
1 month 13 hours ago

Please help me to resolve this: Description:Field topicRepository in io.springbootquickstart.topic.TopicService required a bean of type 'io.springbootquickstart.topic.TopicRepository' that could not be found.Action:Consider defining a bean of type 'io.springbootquickstart.topic.TopicRepository' in your configuration.

Vivek Naskar
Guest
Vivek Naskar
1 month 12 hours ago

Got it:Used the following annotations:@SpringBootApplication@ComponentScan("com.stsproject")@EnableJpaRepositories("io.springbootquickstart.topic")@EntityScan(basePackages = "io.springbootquickstart.topic")

George Tanev
Guest
George Tanev
1 month 3 days ago

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.

Reborn
Guest
Reborn
6 days 13 hours ago

In case if you didn't you know… Spring Data (JPA) is built on top of Hibernate. It's clearly seen everywhere:1) when you launch application there are some logs from hibernate activity2) From Spring InitializerP.S in case if you need some custom Query but using Spring Data you can use @Query("query_goes_here").Now, in brackets you need to write query using SPeL(Spring Expression Language") which will be converted and translated to hibernate.

Fladio Armandika
Guest
Fladio Armandika
2 months 59 minutes ago

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)

Reborn
Guest
Reborn
6 days 13 hours ago

You are using wrong import for LoggerFactory. I'd suggest you to use import org.slf4j.Logger (which is preconfigured and comes with spring boot.Just create bean like this under main() method:@Bean@Scope("prototype") //creates new instance of the specified class, if no instances found for particular classpublic Logger logger() { return LoggerFactory.getLogger(this.getClass());}and you are ready to invoke it anywhere!

ch0c89
Guest
ch0c89
2 months 10 days ago

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();

erluxman
Guest
erluxman
2 months 13 days ago

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 🙂

1 2 3 4
wpDiscuz