add: create worker account on first launch

This commit is contained in:
Johannes Kantz
2023-02-04 18:49:22 +01:00
parent b37cd2ad38
commit cd8e4c9b3d
4 changed files with 42 additions and 13 deletions

View File

@@ -4,21 +4,30 @@ import java.util.ArrayList;
import java.util.List;
/**
* one constructor is used to create new parents the other is used to create existing parents from database
* one constructor is used to create new parents the other is used to create
* existing parents from database
*
* @author Malte Schulze Hobeling
*/
public class Parent extends User{
public class Parent extends User {
List<Child> children;
public Parent(long id, String name, String firstname, String password, String email, Address address, List<Child> children) {
public Parent(long id, String name, String firstname, String password, String email, Address address,
List<Child> children) {
super(id, name, firstname, password, email, address);
this.children = children;
}
public Parent(String name, String firstname, String password, String email, Address address) {
super(name, firstname, password, email, address);
this.children = new ArrayList<>();
}
public Parent(User user) {
super(user.getId(), user.getName(), user.getFirstname(), user.getPassword(), user.getEmail(), user.getAddress());
this.children = new ArrayList<>();
}
public List<Child> getChildren() {
return children;
}