Package ehealth.ts
Class UserWriter
java.lang.Object
ehealth.ts.UserWriter
Manages insert operations into the table users, patients, and doctors
ensuring that no integrity constraints will be violated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidwriteDoctor(Doctor doctor, AuthCredentials authCredentials) Inserts a new doctor.static voidwritePatient(Patient patient, AuthCredentials authCredentials) Inserts a new patient.static voidwritePharmacist(Pharmacist pharmacist, AuthCredentials authCredentials) Inserts a new pharmacist.
-
Method Details
-
writeDoctor
public static void writeDoctor(Doctor doctor, AuthCredentials authCredentials) throws DBException, UniquenessViolationException Inserts a new doctor.- Parameters:
doctor- the user to insertauthCredentials- the auth credentials to store- Throws:
DBException- thrown on any database access or transaction related errorUniquenessViolationException- thrown if email or login is already in use
-
writePatient
public static void writePatient(Patient patient, AuthCredentials authCredentials) throws DBException, UniquenessViolationException Inserts a new patient.- Parameters:
doctor- the user to insertauthCredentials- the auth credentials to store- Throws:
DBException- thrown on any database access or transaction related errorUniquenessViolationException- thrown if email or login is already in use
-
writePharmacist
public static void writePharmacist(Pharmacist pharmacist, AuthCredentials authCredentials) throws DBException, UniquenessViolationException Inserts a new pharmacist.- Parameters:
doctor- the user to insertauthCredentials- the auth credentials to store- Throws:
DBException- thrown on any database access or transaction related errorUniquenessViolationException- thrown if email or login is already in use
-