01: /*
02: * Copyright 2002-2003 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: Queryable.java,v 1.4 2004/01/18 05:46:55 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: /**
14: * Indicates an object that can be queried, such as an Extent or persistent
15: * collection.
16: *
17: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
18: * @version $Revision: 1.4 $
19: *
20: * @see QueryStatement
21: */
22:
23: public interface Queryable {
24: /**
25: * Returns the default class of candidate objects contained in this
26: * queryable collection.
27: *
28: * @return
29: * The default candidate class.
30: */
31: Class getCandidateClass();
32:
33: /**
34: * Returns a prototypical query statement over the underlying collection,
35: * pre-filtered to include only objects of the specified class.
36: *
37: * @param candidateClass
38: * The class of objects to query over.
39: * @return
40: * The new prototypical query statement.
41: *
42: * @exception JDOUserException
43: * If <var>candidateClass</var> is not the same as or a subclass of
44: * the defined element type for this collection.
45: */
46: QueryStatement newQueryStatement(Class candidateClass);
47:
48: /**
49: * Returns a suitable query result factory for results produced by the
50: * specified query.
51: * <p>
52: * The <var>stmt</var> argument must have been obtained by a previous call
53: * to newQueryStatement() on the same Queryable.
54: *
55: * @return
56: * A factory for creating PersistenceCapable objects from query
57: * results.
58: */
59: Query.ResultObjectFactory newResultObjectFactory(QueryStatement stmt);
60: }
|