KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > entity > DelegatorInterface


1 /*
2  * $Id: DelegatorInterface.java 5831 2005-09-26 06:52:24Z jonesde $
3  *
4  * Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  */

25 package org.ofbiz.entity;
26
27 import java.util.Collection JavaDoc;
28 import java.util.List JavaDoc;
29 import java.util.Map JavaDoc;
30 import java.util.Set JavaDoc;
31
32 import org.ofbiz.entity.cache.Cache;
33 import org.ofbiz.entity.condition.EntityCondition;
34 import org.ofbiz.entity.datasource.GenericHelper;
35 import org.ofbiz.entity.model.ModelEntity;
36 import org.ofbiz.entity.model.ModelFieldType;
37 import org.ofbiz.entity.model.ModelGroupReader;
38 import org.ofbiz.entity.model.ModelReader;
39 import org.ofbiz.entity.util.EntityFindOptions;
40 import org.ofbiz.entity.util.EntityListIterator;
41 import org.ofbiz.entity.util.SequenceUtil;
42
43 /**
44  * Delegator Interface
45  *
46  * @author <a HREF="mailto:plightbo@cisco.com">Patrick Lightbody</a>
47  * @version $Rev: 5831 $
48  * @since 2.0
49  */

50 public interface DelegatorInterface {
51
52     String JavaDoc getDelegatorName();
53
54     ModelReader getModelReader();
55
56     ModelGroupReader getModelGroupReader();
57
58     ModelEntity getModelEntity(String JavaDoc entityName);
59
60     String JavaDoc getEntityGroupName(String JavaDoc entityName);
61
62     List JavaDoc getModelEntitiesByGroup(String JavaDoc groupName);
63
64     Map JavaDoc getModelEntityMapByGroup(String JavaDoc groupName);
65
66     String JavaDoc getGroupHelperName(String JavaDoc groupName);
67
68     String JavaDoc getEntityHelperName(String JavaDoc entityName);
69
70     String JavaDoc getEntityHelperName(ModelEntity entity);
71
72     GenericHelper getEntityHelper(String JavaDoc entityName) throws GenericEntityException;
73
74     GenericHelper getEntityHelper(ModelEntity entity) throws GenericEntityException;
75
76     ModelFieldType getEntityFieldType(ModelEntity entity, String JavaDoc type) throws GenericEntityException;
77
78     Collection JavaDoc getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException;
79
80     GenericValue makeValue(String JavaDoc entityName, Map JavaDoc fields);
81
82     GenericValue makeValidValue(String JavaDoc entityName, Map JavaDoc fields);
83
84     GenericPK makePK(String JavaDoc entityName, Map JavaDoc fields);
85
86     GenericValue create(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
87
88     GenericValue create(GenericValue value) throws GenericEntityException;
89
90     GenericValue create(GenericValue value, boolean doCacheClear) throws GenericEntityException;
91
92     GenericValue create(GenericPK primaryKey) throws GenericEntityException;
93
94     GenericValue create(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException;
95
96     GenericValue createOrStore(GenericValue value, boolean doCacheClear) throws GenericEntityException;
97
98     GenericValue createOrStore(GenericValue value) throws GenericEntityException;
99
100     GenericValue findByPrimaryKey(GenericPK primaryKey) throws GenericEntityException;
101
102     GenericValue findByPrimaryKeyCache(GenericPK primaryKey) throws GenericEntityException;
103
104     GenericValue findByPrimaryKey(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
105
106     GenericValue findByPrimaryKeyCache(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
107
108     GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set JavaDoc keys) throws GenericEntityException;
109
110     List JavaDoc findAllByPrimaryKeys(Collection JavaDoc primaryKeys) throws GenericEntityException;
111
112     List JavaDoc findAllByPrimaryKeysCache(Collection JavaDoc primaryKeys) throws GenericEntityException;
113
114     int removeByPrimaryKey(GenericPK primaryKey) throws GenericEntityException;
115
116     int removeByPrimaryKey(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException;
117
118     int removeValue(GenericValue value) throws GenericEntityException;
119
120     int removeValue(GenericValue value, boolean doCacheClear) throws GenericEntityException;
121
122     List JavaDoc findAll(String JavaDoc entityName) throws GenericEntityException;
123
124     List JavaDoc findAll(String JavaDoc entityName, List JavaDoc orderBy) throws GenericEntityException;
125
126     List JavaDoc findAllCache(String JavaDoc entityName) throws GenericEntityException;
127
128     List JavaDoc findAllCache(String JavaDoc entityName, List JavaDoc orderBy) throws GenericEntityException;
129
130     List JavaDoc findByAnd(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
131
132     List JavaDoc findByOr(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
133
134     List JavaDoc findByAnd(String JavaDoc entityName, Map JavaDoc fields, List JavaDoc orderBy) throws GenericEntityException;
135
136     //List findByAnd(ModelEntity modelEntity, Map fields, List orderBy) throws GenericEntityException;
137

138     List JavaDoc findByOr(String JavaDoc entityName, Map JavaDoc fields, List JavaDoc orderBy) throws GenericEntityException;
139
140     List JavaDoc findByAndCache(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
141
142     List JavaDoc findByAndCache(String JavaDoc entityName, Map JavaDoc fields, List JavaDoc orderBy) throws GenericEntityException;
143
144     List JavaDoc findByAnd(String JavaDoc entityName, List JavaDoc expressions) throws GenericEntityException;
145
146     List JavaDoc findByOr(String JavaDoc entityName, List JavaDoc expressions) throws GenericEntityException;
147
148     List JavaDoc findByAnd(String JavaDoc entityName, List JavaDoc expressions, List JavaDoc orderBy) throws GenericEntityException;
149
150     List JavaDoc findByOr(String JavaDoc entityName, List JavaDoc expressions, List JavaDoc orderBy) throws GenericEntityException;
151
152     List JavaDoc findByLike(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
153
154     List JavaDoc findByLike(String JavaDoc entityName, Map JavaDoc fields, List JavaDoc orderBy) throws GenericEntityException;
155
156     List JavaDoc findByCondition(String JavaDoc entityName, EntityCondition entityCondition, Collection JavaDoc fieldsToSelect, List JavaDoc orderBy) throws GenericEntityException;
157
158     EntityListIterator findListIteratorByCondition(String JavaDoc entityName, EntityCondition entityCondition,
159         Collection JavaDoc fieldsToSelect, List JavaDoc orderBy) throws GenericEntityException;
160
161     EntityListIterator findListIteratorByCondition(String JavaDoc entityName, EntityCondition whereEntityCondition,
162         EntityCondition havingEntityCondition, Collection JavaDoc fieldsToSelect, List JavaDoc orderBy, EntityFindOptions findOptions)
163         throws GenericEntityException;
164
165     int removeByAnd(String JavaDoc entityName, Map JavaDoc fields) throws GenericEntityException;
166
167     int removeByAnd(String JavaDoc entityName, Map JavaDoc fields, boolean doCacheClear) throws GenericEntityException;
168
169     int removeByCondition(String JavaDoc entityName, EntityCondition condition) throws GenericEntityException;
170
171     int removeByCondition(String JavaDoc entityName, EntityCondition condition, boolean doCacheClear) throws GenericEntityException;
172
173     List JavaDoc getMultiRelation(GenericValue value, String JavaDoc relationNameOne, String JavaDoc relationNameTwo, List JavaDoc orderBy) throws GenericEntityException;
174
175     List JavaDoc getMultiRelation(GenericValue value, String JavaDoc relationNameOne, String JavaDoc relationNameTwo) throws GenericEntityException;
176
177     List JavaDoc getRelated(String JavaDoc relationName, GenericValue value) throws GenericEntityException;
178
179     List JavaDoc getRelatedByAnd(String JavaDoc relationName, Map JavaDoc byAndFields, GenericValue value) throws GenericEntityException;
180
181     List JavaDoc getRelatedOrderBy(String JavaDoc relationName, List JavaDoc orderBy, GenericValue value) throws GenericEntityException;
182
183     List JavaDoc getRelated(String JavaDoc relationName, Map JavaDoc byAndFields, List JavaDoc orderBy, GenericValue value) throws GenericEntityException;
184
185     GenericPK getRelatedDummyPK(String JavaDoc relationName, Map JavaDoc byAndFields, GenericValue value) throws GenericEntityException;
186
187     List JavaDoc getRelatedCache(String JavaDoc relationName, GenericValue value) throws GenericEntityException;
188
189     GenericValue getRelatedOne(String JavaDoc relationName, GenericValue value) throws GenericEntityException;
190
191     GenericValue getRelatedOneCache(String JavaDoc relationName, GenericValue value) throws GenericEntityException;
192
193     int removeRelated(String JavaDoc relationName, GenericValue value) throws GenericEntityException;
194
195     int removeRelated(String JavaDoc relationName, GenericValue value, boolean doCacheClear) throws GenericEntityException;
196
197     void refresh(GenericValue value) throws GenericEntityException;
198
199     void refresh(GenericValue value, boolean doCacheClear) throws GenericEntityException;
200
201     int store(GenericValue value) throws GenericEntityException;
202
203     int store(GenericValue value, boolean doCacheClear) throws GenericEntityException;
204
205     int storeAll(List JavaDoc values) throws GenericEntityException;
206
207     int storeAll(List JavaDoc values, boolean doCacheClear) throws GenericEntityException;
208
209     int storeByCondition(String JavaDoc entityName, Map JavaDoc fieldsToSet, EntityCondition condition) throws GenericEntityException;
210
211     int storeByCondition(String JavaDoc entityName, Map JavaDoc fieldsToSet, EntityCondition condition, boolean doCacheClear) throws GenericEntityException;
212
213     int removeAll(List JavaDoc dummyPKs) throws GenericEntityException;
214
215     int removeAll(List JavaDoc dummyPKs, boolean doCacheClear) throws GenericEntityException;
216
217     void clearAllCaches();
218
219     void clearAllCaches(boolean distribute);
220
221     void clearCacheLine(String JavaDoc entityName, Map JavaDoc fields);
222
223     void clearCacheLineFlexible(GenericEntity dummyPK);
224
225     void clearCacheLineFlexible(GenericEntity dummyPK, boolean distribute);
226
227     void clearCacheLine(GenericPK primaryKey);
228
229     void clearCacheLine(GenericPK primaryKey, boolean distribute);
230
231     void clearCacheLine(GenericValue value);
232
233     void clearCacheLine(GenericValue value, boolean distribute);
234
235     void clearCacheLineByCondition(String JavaDoc entityName, EntityCondition condition);
236
237     void clearAllCacheLinesByDummyPK(Collection JavaDoc dummyPKs);
238
239     void clearAllCacheLinesByValue(Collection JavaDoc values);
240
241     GenericValue getFromPrimaryKeyCache(GenericPK primaryKey);
242
243     String JavaDoc getNextSeqId(String JavaDoc seqName);
244     String JavaDoc getNextSeqId(String JavaDoc seqName, long staggerMax);
245     Long JavaDoc getNextSeqIdLong(String JavaDoc seqName);
246     Long JavaDoc getNextSeqIdLong(String JavaDoc seqName, long staggerMax);
247
248     void setSequencer(SequenceUtil sequencer);
249
250     void refreshSequencer();
251
252     Cache getCache();
253 }
254
Popular Tags