-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SBA completed. #12
base: master
Are you sure you want to change the base?
SBA completed. #12
Conversation
…fter successful registration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done.
please ensure that you have tests to account for some amount of test coverage of the application.
|
||
//nullary constructor | ||
public Student(){ | ||
this(null,null,null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this(null,null,null)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Will do. thank you.
.findFirst() | ||
.get(); | ||
}catch(NullPointerException| NoSuchElementException e){ | ||
System.out.println("Email address does not exist. Please enter valid email."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice exception handling
} | ||
|
||
@Override | ||
public Boolean validateStudent(String studentEmail, String password) { | ||
return null; | ||
Boolean studentExists = getAllStudents() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider
password.equals(Objects.requireNonNull(getStudentByEmail(studentEmail)).getPassword());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the one liner, I could not have thought about it! Trying it now. Thank you.
( I thought of using anyMatch() as it does not throw exception and returns false if the stream is empty. )
try{ | ||
String registerCourse = "INSERT INTO StudentCourses VALUES (?, ?)"; | ||
PreparedStatement insertStatement = dbc.getDatabaseConnection().prepareStatement(registerCourse); | ||
insertStatement.setString(1, studentEmail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see previous remarks
No description provided.