Food, User

This commit is contained in:
2023-01-27 15:14:36 +01:00
parent b97fe83f40
commit a0eed3ce51
10 changed files with 366 additions and 100 deletions

View File

@@ -84,6 +84,19 @@ public class AccountMgr {
return id;
}
protected static User getUserById(long id){
List<String> entry = Database.getEntryById("user",id);
String[] parts = entry.get(0).split(":");
Address address = getAddressById(id);
return new User(id,parts[1],parts[2],parts[4],parts[5],address,isWorker(String.valueOf(id)),isParent(String.valueOf(id)));
}
protected static Address getAddressById(long id){
List<String> entry = Database.getEntryById("address",id);
String[] parts = entry.get(0).split(":");
return new Address(Long.parseLong(parts[0]),parts[1],parts[2],parts[3],parts[4]);
}
/**
* creates entries in the database to match parent to child
* @param parentId id of parent