-
Notifications
You must be signed in to change notification settings - Fork 0
Persistence
Persistence in this project is achieved using an H2 database, which stores donation history and user accounts.
CREATE TABLE IF NOT EXISTS
users (
user_id INT PRIMARY KEY,
role VARCHAR(32) NOT NULL,
first_name VARCHAR(32) NOT NULL,
last_name VARCHAR(32) NOT NULL,
email VARCHAR(32) NOT NULL,
password_hash VARCHAR(72) NOT NULL
);This table contains information about each user, and is accessed by the DbWrapper's importUsers() method and modified with exportUsers(List<Object[]> data).
CREATE TABLE IF NOT EXISTS
donations (
donation_id INT PRIMARY KEY,
user_id INT NOT NULL,
organization_id INT NOT NULL,
amount DECIMAL(32, 16) NOT NULL,
dating TIMESTAMP NOT NULL,
payment_method VARCHAR(32) NOT NULL,
CONSTRAINT fk_user
FOREIGN KEY (user_id)
REFERENCES users(user_id)
);This table contains information about each donation, and is accessed by the DbWrapper's fetchAllDonations() and importDonations(int user_id) methods, and modified by the exportDonations(List<Object[]> data) method.
The table contains a foreign key user_id, which connects to the user table's primary key of the same name.
This class functions as a wrapper around the database and manages interaction with the user and the donation table.
📘 Project Wiki
Last updated: April 2026
Maintained by (BIDATA) Team 5 in the course IDATT1005