I'm experimenting with play (v2.2.2), and I have it connected to MongoDB (v2.4.6) using jackson.
I have a models.Role
class with the following attributes:
@Id
@ObjectId
public String id;
public String name;
public ArrayList<String> permissions;
On the template (roles.scala.html
), I can easily get the list of permissions to be printed on the HTML, but when I try to add a new role passing a single permission as a string in the form as an @InputText
field, it does not get recorded in MongoDB. I suppose that it is because play/scala is trying to assign a simple String
to an ArrayList<String>
.
Any ideas on the propper approach? Maybe I should do some logic on the create()
method under Role class?