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

Finished with SBA. #15

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@




test



Expand Down
8 changes: 3 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.18</version>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
</dependency>

<dependency>
Expand All @@ -36,14 +36,12 @@
<scope>test</scope>
</dependency>


<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.0</version>
</dependency>


<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.0-api -->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/github/perscholas/DashboardOption.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.github.perscholas;

public enum DashboardOption {
LOGIN("Login Dashboard"), DEBUG("Debug Screen"), VIEW("View Your Courses Dashboard"),
REGISTER("Registration Dashboard"), LOGOUT("Logout of Account"), EXIT("Exit Application");

private String title;

private DashboardOption(String title) {
this.title = title;
}

public static boolean isValid(String value) {
try {
DashboardOption.valueOf(value);
} catch (Exception e) {
return false;
}
return true;
}

public String display() {
return String.format("[ %s ]", toString());
}
}
78 changes: 0 additions & 78 deletions src/main/java/com/github/perscholas/DatabaseConnection.java

This file was deleted.

38 changes: 0 additions & 38 deletions src/main/java/com/github/perscholas/JdbcConfigurator.java

This file was deleted.

17 changes: 15 additions & 2 deletions src/main/java/com/github/perscholas/MainApplication.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
package com.github.perscholas;

import com.github.perscholas.config.JpaConfigurator;
import com.github.perscholas.dao.CourseRepository;
import com.github.perscholas.dao.StudentRepository;
import com.github.perscholas.service.CourseService;
import com.github.perscholas.service.StudentService;

import javax.persistence.EntityManagerFactory;

public class MainApplication {
public static void main(String[] args) {
JdbcConfigurator.initialize();
Runnable sms = new SchoolManagementSystem();
JpaConfigurator.initialize();
EntityManagerFactory entityManagerFactory = JpaConfigurator.getEntityManagerFactory();
CourseRepository courseRepository = new CourseRepository(entityManagerFactory);
StudentRepository studentRepository = new StudentRepository(entityManagerFactory, courseRepository);
StudentService studentService = new StudentService(studentRepository);
CourseService courseService = new CourseService(courseRepository);
Runnable sms = new SchoolManagementSystem(studentService, courseService, entityManagerFactory);
sms.run();
}
}
Loading