/** */
@Test
public void testManyToOne() throws Exception {
fact().register(Employee.class);
Employee fred = new Employee("fred");
ofy().save().entity(fred).now();
Key<Employee> fredKey = Key.create(fred);
List<Employee> employees = new ArrayList<>(100);
for (int i = 0; i < 100; i++)
{
Employee emp = new Employee("foo" + i, fredKey);
employees.add(emp);
}
ofy().save().entities(employees).now();
assert employees.size() == 100;
int count = 0;
for (Employee emp: ofy().load().type(Employee.class).filter("manager", fred))
{
emp.getName(); // Just to make eclipse happy
count++;
}
assert count == 100;
}