FileDocCategorySizeDatePackage
ContentQueries.javaAPI DocExample1402Sun Nov 03 21:10:58 GMT 2002com.mediamania.content

ContentQueries

public class ContentQueries extends Object

Fields Summary
Constructors Summary
Methods Summary
public static MediaPersongetMediaPerson(javax.jdo.PersistenceManager pm, java.lang.String person)

        Extent personExtent = pm.getExtent(
                       com.mediamania.content.MediaPerson.class, false);
        Query query = pm.newQuery(personExtent, "mediaName == person");
        query.declareParameters("String person");
        Collection result = (Collection) query.execute(person);
        Iterator iter = result.iterator();
        MediaPerson mediaPerson =
            (MediaPerson) (iter.hasNext() ? iter.next() : null);
        query.close(result);
        return mediaPerson;
    
public static StudiogetStudioByName(javax.jdo.PersistenceManager pm, java.lang.String studioName)

        Extent studioExtent = pm.getExtent(com.mediamania.content.Studio.class,
                                           false);
        Query query = pm.newQuery(studioExtent, "name == studioName");
        query.declareParameters("String studioName");
        Collection result = (Collection) query.execute(studioName);
        Iterator iter = result.iterator();
        Studio studio = (Studio) (iter.hasNext() ? iter.next() : null);
        query.close(result);
        return studio;