5

I have a ManyToMany-Association like this:

@Entity
public class User extends Model implements RoleHolder {
  @ManyToMany(cascade=CascadeType.ALL) 
  public List<Task> tasks;
}

Then I do that:

User u = Application.getLocalUser(session());
u.tasks.clear();
for (Task t : tasksToAdd)
  u.tasks.add(t);
u.saveManyToManyAssociations("tasks");
u.update()

But when I try to read the Collection in my Controller-Action, there is only a "BeanList deferred"-Message

User u = Application.getLocalUser(session());       
return ok(tasks.render(u.tasks));

Thank you for your help

Sheena
  • 15,590
  • 14
  • 75
  • 113
bembii
  • 259
  • 2
  • 12

1 Answers1

0

I had the same message when implementing a @ManyToMany association.

The problem in my case was that I forgot to save() (i.e. insert) Entity Y after adding it to List<Y> in Entity X.

schmittsfn
  • 1,412
  • 18
  • 40