I have a problem. I'm building a service, that can use a oauth-service, to get some userinformation. I would like to persist the OAuthService, on the user, because I need to get the data, until the accessToken expires(That differs from each providers)..
I use the play2-morphia-plugin for data persistance, and Scribe for OAuth..
Here's my user class:
package models;
import leodagdag.play2morphia.Model;
import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import org.bson.types.ObjectId;
import org.scribe.oauth.OAuthService;
@Entity
public class User extends Model{
@Id
private ObjectId id;
private List<OAuthService> services;
//Getters and setters...
}
I can save the object. No problem, but when i try to load it, I get an error because it doesn't have an default empty constructor.
I can put the code on github, if you would like?