RaiderException Entity Relationship Diagram and Sample SQL - rsanchez-wsu/RaiderPlanner GitHub Wiki
RaiderException
RaiderException is a custom exception class that provides a more user friendly error reporting feature. In addition to simpler error reporting, RaiderExceptions are also stored on a local database for records off all exceptions that get thrown in RaiderPlanner. Below is the entity relationship diagram that shows the Exceptions entity and its attributes.
SQL Implementation
In order to implement database functionality, we must first create the database and the corresponding tables to record all the exceptions that occur. Below are some examples:
/*Table Creation*/
CREATE TABLE Exceptions (
ExID INT PRIMARY KEY,
message VARCHAR2(MAX) NOT NULL,
type VARCHAR2(20) NOT NULL,
time TIME,
date DATE);
/*User wants to get all the exceptions that occurred on October 1st at 3:30pm*/
SELECT *
FROM Exceptions
WHERE date = '2018-10-01' AND time = '3:30pm';
/*User wants the dates and times of all the Null Pointer Exceptions*/
SELECT date, time
FROM Exceptions
WHERE type = 'NullPointerException';
/*Return all the exceptions thrown*/
SELECT *
FROM Exceptions;
/*Get all the Exceptions that were thrown from file not found errors.*/
SELECT ExID
FROM Exceptions
WHERE message LIKE '%file%not%found%';