This is my User class
public class User extends Model {
@Id
public Long id;
public String nome;
public String email;
public String webId; //ID of the user in the provider website
public String passwordHash;
public String service;
//Relazioni
private Set<Long> idEvents = new HashSet<Long>();
...
private Set<Long> idPhotos= new HashSet<Long>();
public User(String email, String name,String webId, String passwordHash, String service) throws Exception {
...
}
static Query<User> all() {
return Model.all(User.class);
}
public static User findByEmail(String email){
return all().filter("email", email).get();
}
}
When I create it and insert it to the database it seems to work fine. But then when I recall it from the DB using findByEmail(email). It loads a user with all the Sets (like idEvents) nulls.
I'm using play 1.1 with siena and gae modules.
Any idea on what could be wrong? I tried declaring the sets public and using a list instead of a set, but nothing worked.
Thanks