Note that there are some explanatory texts on larger screens.

plurals
  1. POJDO basics: List or array won't retrieve or return with GWT RPC
    text
    copied!<p>I've been using Objectify up till now, but now I have to deal with some code using JDO. I'm having problems with basic stuff that is easy with Objectify, specifically: if an object has either a List or an array as a member, I can't get that to persist.</p> <p>I have a class FileInfoBatch (code indents lost here, don't know why) containing a List of FileInfo:</p> <pre><code>@PersistenceCapable public class FileInfoBatch implements Serializable{ private static final long serialVersionUID = 1L; @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private List&lt;FileInfo&gt; fileInfoList; @Persistent private String savedByUserEmail; public FileInfoBatch(){ fileInfoList=new ArrayList&lt;FileInfo&gt;(); } </code></pre> <p>Then I send a FileInfoBatch (called fib) containing just 1 FileInfo in the List, to my RPC impl class &amp; persist it, then query for it straight away for a test (in debugger)</p> <pre><code> PersistenceManager pm = PMF.get().getPersistenceManager(); pm.makePersistent(fib); Query query = pm.newQuery(FileInfoBatch.class, "savedByUserEmail == '"+ userEmail + "'"); List&lt;FileInfoBatch&gt; savedList = (List&lt;FileInfoBatch&gt;) query.execute(); FileInfoBatch persisted=savedList.get(0); </code></pre> <p>The persisted FileInfoBatch comes back with an empty FileInfo list. If I use a single Fileinfo member, this persists ok.</p> <p>I find no such basic problem reported on this site &amp; I've looked at the docs: <a href="https://developers.google.com/appengine/docs/java/datastore/jdo/dataclasses" rel="nofollow">https://developers.google.com/appengine/docs/java/datastore/jdo/dataclasses</a></p> <p>Does such a simple storage task require huge complexity? If so I will go back to using Objectify.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload