KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > query > api > QueryDefinition


1 /**
2  * Speedo: an implementation of JDO compliant personality on top of JORM generic
3  * I/O sub-system.
4  * Copyright (C) 2001-2004 France Telecom R&D
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  *
21  *
22  * Contact: speedo@objectweb.org
23  *
24  * Authors: S.Chassande-Barrioz.
25  *
26  */

27
28 package org.objectweb.speedo.query.api;
29
30 import javax.jdo.Extent;
31 import java.util.Collection JavaDoc;
32 import java.util.List JavaDoc;
33
34 /**
35  * This interface represents the user definition of a query.
36  *
37  * @author S.Chassande-Barrioz
38  */

39 public interface QueryDefinition {
40
41     Class JavaDoc getCandidateClass();
42
43     boolean isCollection();
44
45     Collection JavaDoc getCollection();
46
47     String JavaDoc getParameters();
48
49     String JavaDoc getVariables();
50
51     String JavaDoc getFilter();
52
53     Extent getExtent();
54
55     List JavaDoc getImportStatements();
56
57     boolean isIgnoreCache();
58
59     List JavaDoc getOrder();
60
61     boolean equals(Object JavaDoc o);
62
63     int hashCode();
64     
65     boolean withPrefetch();
66     
67     void withPrefetch(boolean withPrefetch);
68
69     String JavaDoc qdToString(boolean oneLine);
70
71     /**
72      * The application may want to skip some number of results that may have
73      * been previously returned, and additionally may want to limit the number
74      * of instances returned from a query. The default range for query execution
75      * if this method is not called are (0, Long.MAX_VALUE).
76      */

77     long getIndexFirst();
78
79     /**
80      * The application may want to skip some number of results that may have
81      * been previously returned, and additionally may want to limit the number
82      * of instances returned from a query. The default range for query execution
83      * if this method is not called are (0, Long.MAX_VALUE).
84      */

85     long getIndexLast();
86
87     /**
88      * If the application knows that there can be exactly zero or one instance
89      * returned from a query, the result of the query is most conveniently
90      * returned as an instance (possibily null) instead of a Collection.
91      */

92     boolean getUnique();
93
94     /**
95      * The application wmight want to get results from a query that are not
96      * instance of the candidate class. The results might be fields of
97      * persistent instances, instances of classes other than the candidate
98      * class, or aggregates of fields.
99      */

100     String JavaDoc getResult();
101
102     /**
103      * The application may have a user-defined class that best represents the
104      * results of a query. In this case, the application can specify that
105      * instances of this class should be returned.
106      */

107     Class JavaDoc getResultClass();
108     
109     /**
110      * indicates if subclasses must be returned too
111      */

112     boolean getIncludeSubClasses();
113
114     
115     /**
116      * List of grouped fields
117      */

118     String JavaDoc getGrouping();
119 }
120
Popular Tags