according to the documentation the model should be like this
public class Employee
{
@Id String name;
Key<Employee>[] subordinates;
}
I need to know how can I add subordinates to an Employee.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A better approach would probably be for each
Subordinateentity, to have a property with its manager, like this:In any case, if you still want to have a list of subordinates in each
Employeeentity, first you get the entity, you add theKeyof the subordinate to the list, and you save the entity.Hope this helps.