What is the correct way to eager fetch a nested collection in ebean and Play Framework 2? I tried this:
Registration registration = find
.fetch("participants")
.fetch("participants.fieldValues")
.fetch("participants.fieldValues.field")
.where().eq("token", token).findUnique();
For some reason registration.participants.fieldValues.field
objects only have an id. The rest of the field
properties are null. E.g. field.name
is null when it should have a value.
Edit:
If I make Field.name private and add a getter/setter for it, then I can get its value. But since I'm using fetch("participants.fieldValues.field")
shouldn't that make it eager fetch without needing the getter/setter?