1
0
Fork 0

Init DB table class

This commit is contained in:
Ethanell 2020-12-14 12:05:24 +01:00
parent 3a7875742d
commit 307c0b59eb
9 changed files with 338 additions and 0 deletions

View file

@ -10,6 +10,7 @@ repositories {
} }
dependencies { dependencies {
implementation 'org.projectlombok:lombok:1.18.16'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
} }

View file

@ -0,0 +1,78 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
/**
* # Competition
* <p>
* ## name
* <p>
* The event name
* <p>
* ## days
* <p>
* The number of days a competition is planned
* <p>
* ## movies
* <p>
* The number of movies per day
* <p>
* ## movieMax
* <p>
* The maximum number of different movies projected
*/
public class Competition implements Table {
@Getter @Setter private String name;
@Getter @Setter private int days;
@Getter @Setter private int movies;
@Getter @Setter private int movieMax;
public Competition() {
}
static public ArrayList<Competition> getAll() {
return null;
}
static public ArrayList<Competition> getAvailable() {
return null;
}
public ArrayList<User> getUsers() {
return null;
}
public ArrayList<Slot> getSlots() {
return null;
}
public ArrayList<Room> getRooms() {
return null;
}
public ArrayList<Projection> getProjections() {
return null;
}
public ArrayList<Movie> getTableMovies() {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}

View file

@ -0,0 +1,44 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.time.Duration;
import java.util.ArrayList;
public class Movie implements Table {
@Getter @Setter private String name;
@Getter @Setter private User director;
@Getter @Setter private Duration duration;
@Getter @Setter private Competition competition;
public Movie() {
}
static public ArrayList<Movie> getAll() {
return null;
}
static public ArrayList<Movie> getAvailable(Competition competition) {
return null;
}
public ArrayList<Projection> getProjections() {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}

View file

@ -0,0 +1,40 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.Date;
public class Projection implements Table {
@Getter @Setter private Date startDate;
@Getter @Setter private Competition competition;
@Getter @Setter private Room room;
@Setter @Getter private Movie movie;
public Projection() {
}
static public ArrayList<Projection> getAll() {
return null;
}
static public ArrayList<Projection> getAvailable(Competition competition) {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}

View file

@ -0,0 +1,44 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
public class Room implements Table {
@Getter @Setter private int places;
public Room() {
}
static public ArrayList<Room> getAll() {
return null;
}
static public ArrayList<Room> getAvailable(Movie movie, Slot slot) {
return null;
}
public ArrayList<Competition> getCompetitions() {
return null;
}
public ArrayList<Projection> getProjections() {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}

View file

@ -0,0 +1,42 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.Date;
public class Slot implements Table {
@Getter @Setter private Date startTime;
@Getter @Setter private Competition competition;
public Slot() {
}
static public ArrayList<Slot> getAll() {
return null;
}
static public ArrayList<Slot> getAvailable(Movie movie) {
return null;
}
static public ArrayList<Slot> getAvailable(Competition competition) {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}

View file

@ -0,0 +1,7 @@
package DB;
public interface Table {
public boolean save();
public boolean update();
public boolean delete();
}

View file

@ -0,0 +1,46 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
public class User implements Table {
@Getter @Setter private String firstName;
@Getter @Setter private String lastName;
@Getter @Setter private String phoneNumber;
@Getter @Setter private String email;
@Getter @Setter private UserType type;
@Getter @Setter private Competition competition;
private String passwordHash;
public User() {
}
public String getPassword() {
return null;
}
public boolean setPassword(String password) {
return false;
}
static public ArrayList<User> getAll() {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}

View file

@ -0,0 +1,36 @@
package DB;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
public class UserType implements Table {
@Getter @Setter private String name;
public UserType() {
}
static public ArrayList<UserType> getAll() {
return null;
}
public ArrayList<User> getUsers() {
return null;
}
@Override
public boolean save() {
return false;
}
@Override
public boolean update() {
return false;
}
@Override
public boolean delete() {
return false;
}
}