Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

monicadeshmukh
Copy link

No description provided.

Copy link
Contributor

@Git-Leon Git-Leon left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this(null,null,null)

Copy link
Author

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.");
Copy link
Contributor

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()
Copy link
Contributor

@Git-Leon Git-Leon Sep 7, 2020

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());

Copy link
Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@Git-Leon Git-Leon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous remarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants