KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > Queryable


1 /*
2  * Copyright 2002-2003 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: Queryable.java,v 1.4 2004/01/18 05:46:55 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13
14 /**
15  * Indicates an object that can be queried, such as an Extent or persistent
16  * collection.
17  *
18  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
19  * @version $Revision: 1.4 $
20  *
21  * @see QueryStatement
22  */

23
24 public interface Queryable
25 {
26     /**
27      * Returns the default class of candidate objects contained in this
28      * queryable collection.
29      *
30      * @return
31      * The default candidate class.
32      */

33     Class JavaDoc getCandidateClass();
34
35     /**
36      * Returns a prototypical query statement over the underlying collection,
37      * pre-filtered to include only objects of the specified class.
38      *
39      * @param candidateClass
40      * The class of objects to query over.
41      * @return
42      * The new prototypical query statement.
43      *
44      * @exception JDOUserException
45      * If <var>candidateClass</var> is not the same as or a subclass of
46      * the defined element type for this collection.
47      */

48     QueryStatement newQueryStatement(Class JavaDoc candidateClass);
49
50     /**
51      * Returns a suitable query result factory for results produced by the
52      * specified query.
53      * <p>
54      * The <var>stmt</var> argument must have been obtained by a previous call
55      * to newQueryStatement() on the same Queryable.
56      *
57      * @return
58      * A factory for creating PersistenceCapable objects from query
59      * results.
60      */

61     Query.ResultObjectFactory newResultObjectFactory(QueryStatement stmt);
62 }
63
Popular Tags