KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > query > AbstractQueryImpl


1 package org.apache.ojb.broker.query;
2
3 /* Copyright 2002-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 import java.io.Serializable JavaDoc;
19 import java.util.List JavaDoc;
20
21 /**
22  * Abstract implemenation of Query interface
23  *
24  * @author ???
25  * @version $Id: AbstractQueryImpl.java,v 1.14.2.3 2005/12/21 22:27:09 tomdz Exp $
26  */

27 public abstract class AbstractQueryImpl implements Query, Serializable JavaDoc
28 {
29     static final long serialVersionUID = -6265085604410295816L;
30     
31     private int m_startAtIndex = Query.NO_START_AT_INDEX;
32     private int m_endAtIndex = Query.NO_END_AT_INDEX;
33     private int m_fullSize = 0;
34     private int fetchSize;
35     protected Class JavaDoc m_searchClass;
36     protected Class JavaDoc m_baseClass;
37     private boolean m_withExtents = true;
38
39     public AbstractQueryImpl()
40     {
41     }
42
43     public AbstractQueryImpl(Class JavaDoc aSearchClass)
44     {
45         m_searchClass = aSearchClass;
46         m_baseClass = aSearchClass;
47     }
48
49     public int getStartAtIndex()
50     {
51         return m_startAtIndex;
52     }
53
54     public void setStartAtIndex(int startAtIndex)
55     {
56         m_startAtIndex = startAtIndex;
57     }
58
59     public int getEndAtIndex()
60     {
61         return m_endAtIndex;
62     }
63     
64     public void setEndAtIndex(int endAtIndex)
65     {
66         m_endAtIndex = endAtIndex;
67     }
68     
69     public void fullSize(int size)
70     {
71         m_fullSize = size;
72     }
73     
74     public int fullSize()
75     {
76         return m_fullSize;
77     }
78     
79     public void setWithExtents(boolean withExtents)
80     {
81         m_withExtents = withExtents;
82     }
83     
84     public boolean getWithExtents()
85     {
86         return m_withExtents;
87     }
88
89     /*
90      * @see Query#getSearchClass()
91      */

92     public Class JavaDoc getSearchClass()
93     {
94         return m_searchClass;
95     }
96
97     /*
98      * @see Query#getBaseClass()
99      */

100     public Class JavaDoc getBaseClass()
101     {
102         return m_baseClass;
103     }
104
105     /* (non-Javadoc)
106      * @see org.apache.ojb.broker.query.Query#getGroupBy()
107      */

108     public List JavaDoc getGroupBy()
109     {
110         return null;
111     }
112
113     /* (non-Javadoc)
114      * @see org.apache.ojb.broker.query.Query#getOrderBy()
115      */

116     public List JavaDoc getOrderBy()
117     {
118         return null;
119     }
120
121     /* (non-Javadoc)
122      * @see org.apache.ojb.broker.query.Query#getPrefetchedRelationships()
123      */

124     public List JavaDoc getPrefetchedRelationships()
125     {
126         return null;
127     }
128     
129
130
131     /* (non-Javadoc)
132      * @see org.apache.ojb.broker.query.Query#getCriteria()
133      */

134     public Criteria getCriteria()
135     {
136         return null;
137     }
138
139     /* (non-Javadoc)
140      * @see org.apache.ojb.broker.query.Query#getExampleObject()
141      */

142     public Object JavaDoc getExampleObject()
143     {
144         return null;
145     }
146
147     /* (non-Javadoc)
148      * @see org.apache.ojb.broker.query.Query#getHavingCriteria()
149      */

150     public Criteria getHavingCriteria()
151     {
152         return null;
153     }
154
155     /* (non-Javadoc)
156      * @see org.apache.ojb.broker.query.Query#isDistinct()
157      */

158     public boolean isDistinct()
159     {
160         return false;
161     }
162
163     public boolean usePaging()
164     {
165         return getEndAtIndex() > NO_END_AT_INDEX
166             || getStartAtIndex() > NO_START_AT_INDEX;
167     }
168
169     public void setFetchSize(int fetchSize)
170     {
171         this.fetchSize = fetchSize;
172     }
173
174     public int getFetchSize()
175     {
176         return fetchSize;
177     }
178
179 }
180
Popular Tags