Posts

Showing posts from April, 2023

delete query in springboot

  Let's check the equivalent code for our derived method from earlier: @Modifying @Query("delete from Book b where b.title=:title") void deleteBooks ( @Param("title") String title) ;

to form get date set into RequestMapping to @RequestParam takes date

in request Data from form........  @RequestParam("StartDate") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate strdate Also declare bean in , @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate dob;

Springboot important annotation

Image
  Spring Boot Annotations Spring Boot’s annotations are key to getting up to speed with the framework. They allow you to direct the framework to do your bidding, taking control and overriding its defaults when needed. Annotations are quick, easy to use, and orders of magnitude faster than building the equivalent functionality yourself. You can learn more in Spring’s documentation. The  PDF  or  web  versions are essential reading if you plan on working with Spring Boot. Knowing how to use annotations can level up your game and help you get the most out of the framework. Listed below are several common annotations, some of them with sample code. Spring Boot works with  Java ,  Kotlin , and Groovy. I’ll use Java for the examples in this article. Basic Setup @SpringBootApplication @Configuration @ComponentScan @EnableAutoConfiguration Request Responses @GetMapping @RequestMapping @RequestParam Component Types @Component @Service @Repository @Controller @R...