tags:

views:

105

answers:

1

I have a model that has an array of Strings called tags,

public class Model {
    private String tags[];
    ... 

}

How do I make a query that looks at if the array tags contains a certain string say if a certain model's tag attribute looks like this tags[] = {"Java","Programming"}

I want to make a query in JDO that's gets all Models whose tag attribute has the element "Java".

A: 

Depends on your datastore, and if using DataNucleus. There is no standard JDO way of handling that. With DataNucleus and using RDBMS you can follows the array "contains" method on this page http://www.datanucleus.org/products/accessplatform%5F2%5F0/rdbms/jdoql%5Fmethods.html

With any other datastore with DataNucleus this is likely not yet supported.

DataNucleus
Yes I am using DataNucleus on Google App Engine. AMAZING! Thanks a lot. :D
Jeune