I am able to persist this entity in a servlet with following code:

PersistenceManager pm = PMF.getInstance().getPersistenceManager();
 User abcd = new User();
abcd.setEmail("[email protected]");
abcd.setName("name"); 
 VerificationToken token1 = new 
VerificationToken(abcd,VerificationToken.VerificationTokenType.emailVerification,60);
 
 if(abcd!=null&&token1!=null)
abcd.addVerificationToken(token1);
else
System.err.println("Why me!");
 Poll poll = new Poll();
poll.setQuestion("Hello Good Morning");
List<String> options = new ArrayList<String>();
options.add("option 1");
options.add("option 2");
poll.setOptions(options);
poll.setUser(abcd);
poll.setCloseTime(new Date());
pm.makePersistent(abcd);
pm.makePersistent(poll);
 pm.close();

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to