Food, User
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user