To create different types of Custom Queries in Spring WebFlux with IntelliJ over a Postgres Database.
- Created 2 entities/tables namely - Patient and Doctor within a postgres database and link both together.
create table patient (id serial primary key, name text, age integer);
create table doctor (did serial primary key, dname text, specs text, pid integer, CONSTRAINT "pid_FK" FOREIGN KEY (pid) REFERENCES public.patient(id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL);
- Add 1 entry of Patient by Id
- Get all list of Patients
- Get Patient by Id
- Update Patient (find and match by PID)
- Delete Patient by PId
Same CRUD operations for Doctor table.
- Get only Top 3 entry with age in descending order
- Get all Patient entries through specified string by user contained in the name
- Get all Patient entries having age > age specified by user
- Get only the Patient entry through specified id by user
- Get all Doctor entries through specified specs by user
- Get all Doctor entries through specified specs by user with name in descending order.
- Get only the Doctor entry through specified name by user
- Update only specs of the Doctor entry through specified name by user
- Get all Doctor entries through specified id by user
- This is also included in the application that performs JOIN between Patient and Doctor