I have two classes PaymentJDO and PaymentItemJDO. A payment can have several items. Any payment item is associated with an invoice. 
I want to retrieve every payment which is related to a particular invoice. I have the invoice Id to query. 

```
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PaymentJDO implements BaseOwnedObject, BasicBean {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    protected Long id;

    @Persistent
    private Date date;

    @Persistent
    private String customerId;

    @Persistent
    private String pelicamoId = null;

    @Persistent
    @Element(dependent = "true")
    private List<PaymentItemJDO> items;

    public void setId(Long id) { this.id = id;}

    public String getId() {
        if( id == null ) return null;
        return id.toString();
    }
    public void setId(String id) {
        if(id!=null) {
            this.id = Long.parseLong(id);
        }   
    }

    public Date getDate() { return date;}
    public void setDate(Date date) { this.date = date;}

    public String getCustomerId() { return customerId;}
    public void setCustomerId(String customerId) { this.customerId = customerId;}

    public List<PaymentItemJDO> getItems() { return items;}
    public void setItems(List<PaymentItemJDO> items) {this.items = items;}

    public String getPelicamoId() { return pelicamoId;}
    public void setPelicamoId(String pelicamoId) { this.pelicamoId = pelicamoId;}
}

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class PaymentItemJDO {   
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    protected Key id;

    @Persistent
    private String invoiceId;

    @Persistent
    private double amount;

    public PaymentItemJDO(String invoiceId) {
        setInvoiceId(invoiceId);
    }

    //override equals method for List .contains
    @Override
    public boolean equals(Object item) {
        return ((PaymentItemJDO)item).getInvoiceId().equals(this.invoiceId);
    } 

    public Key getId() { return id;}

    public String getInvoiceId() { return invoiceId;}
    public void setInvoiceId(String invoiceId) { this.invoiceId = invoiceId;}

    public double getAmount() { return amount;}
    public void setAmount(double amount) { this.amount = amount;}
}

```

I have the next function to query the payments related to a particular invoice

```
public List<PaymentJDO> getJDOPayments(String invoiceId)  throws SessionExpiredException {
    PersistenceManager pm = JdoUtil.getPm();        
    Query query = pm.newQuery(PaymentJDO.class);
    String pelicamoId = getCurrentPelicamoId();
    query.setFilter("items.contains(:invoice)");
    return (List<PaymentJDO>) query.execute(new PaymentItemJDO(invoiceId));
}

```

I get the next error

```
javax.jdo.JDOFatalUserException: Illegal argument
    at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:344)
    at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252)
    at com.softamo.pelicamo.server.MainServiceImpl.getJDOPayments(MainServiceImpl.java:947)
    at com.softamo.pelicamo.server.MainServiceImpl.getIncomeSummaries(MainServiceImpl.java:817)
    at com.softamo.pelicamo.server.IncomeServiceTest.testGetIncomeSummaries(IncomeServiceTest.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
NestedThrowablesStackTrace:
java.lang.IllegalArgumentException: items: com.softamo.pelicamo.server.jdo.PaymentItemJDO is not a supported property type.
    at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
    at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:157)
    at com.google.appengine.api.datastore.Query$FilterPredicate.<init>(Query.java:549)
    at com.google.appengine.api.datastore.Query.addFilter(Query.java:235)
    at org.datanucleus.store.appengine.query.DatastoreQuery.addLeftPrimaryExpression(DatastoreQuery.java:1138)
    at org.datanucleus.store.appengine.query.DatastoreQuery.handleContainsOperation(DatastoreQuery.java:987)
    at org.datanucleus.store.appengine.query.DatastoreQuery.addExpression(DatastoreQuery.java:880)
    at org.datanucleus.store.appengine.query.DatastoreQuery.addFilters(DatastoreQuery.java:827)
    at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:228)
    at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:89)
    at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
    at org.datanucleus.store.query.Query.executeWithArray(Query.java:1371)
    at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:243)
    at com.softamo.pelicamo.server.MainServiceImpl.getJDOPayments(MainServiceImpl.java:947)
    at com.softamo.pelicamo.server.MainServiceImpl.getIncomeSummaries(MainServiceImpl.java:817)
    at com.softamo.pelicamo.server.IncomeServiceTest.testGetIncomeSummaries(IncomeServiceTest.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

```