Question
Develop a backend using Spring Boot, REST API, and Spring Data JPA for following CRUD operations for Railway resource offered by an Indian Railway Railway
Develop a backend using Spring Boot, REST API, and Spring Data JPA for following CRUD operations for Railway resource offered by an Indian Railway
Railway (1) <------ > Stations (M) Bidirectional Add new Railway Delete Railway details Fetch all Railway matched by given Railway category Add station details Railway has the following Properties: ID (unique identifier for each Railway, auto generated, starts from 1) Name Category (Enum, example: Express,Shatabdi,AC,Metro) Start_time End_time Source Destiation
Station has the following Properties: Station ID(unique identifier for each Railway, auto generated, starts from 1) station_code Station_Name No_Of_Platforms Railway_Id(FK)
You have to use 1--- > * relationship to save resource. None of the fields in Railway and Station table is nullable. Create Required payloads (DTO) ID(auto generated) There should be validation on create .For example: Start_time cannot be after End_time. Name should not be blank. Rest URL should be named as per REST best practices. Response codes should be as per REST guidelines..(201 for resource creation , 404 for not found , 200 for ok) Error handling in case of failures.
Mandatory Operations: Use Suitable Annotations while creating Hib. POJO(Entity) Implementation of All CRUD operation on Railway as well as Station Payload Validations Implementation of Get Railway by given Category Proper response codes for GET & POST Centralized Error Handling Service and Repository and Entity layers Use PathVariable wherever required For Testing use Postman/Swagger
ApiRespone with string message is desirable. But even if you return a string message, it's also acceptable
Develop this app in a layered manner Rest Controller --Service --DAO --Entities --DB
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started