6/23/2023 0 Comments Java annotations database schema![]() ![]() deleteStudent(): It deletes a specific student that we have specified in the path variable.We have passed id as an argument by using the annotation The annotation indicates that a method parameter should be bound to a URI template variable. getStudent(): It returns a student detail that we have specified in the path variable.getAllStudent(): It returns a List of all Students.Mark the class as RestController by using the annotation Autowire the StudentService class by using the annotation Define the following methods:.In the StudentController class, we have done the following: We have created controller class with the name StudentController. Step 12: Create a Controller class in the package. Step 11: Create a package with the name in the folder src/main/java. mark id as primary id as column int id mark class as an class name as Table class Student Mark the class as Entity by using the annotation Mark the class as Table name by using the annotation Define each variable as Column by using the annotation.Right-click on the file -> Source -> Generate Getters and Setters. ![]()
0 Comments
Leave a Reply. |