1 25 package org.ofbiz.entity; 26 27 import java.util.Collection ; 28 import java.util.List ; 29 import java.util.Map ; 30 import java.util.Set ; 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 50 public interface DelegatorInterface { 51 52 String getDelegatorName(); 53 54 ModelReader getModelReader(); 55 56 ModelGroupReader getModelGroupReader(); 57 58 ModelEntity getModelEntity(String entityName); 59 60 String getEntityGroupName(String entityName); 61 62 List getModelEntitiesByGroup(String groupName); 63 64 Map getModelEntityMapByGroup(String groupName); 65 66 String getGroupHelperName(String groupName); 67 68 String getEntityHelperName(String entityName); 69 70 String getEntityHelperName(ModelEntity entity); 71 72 GenericHelper getEntityHelper(String entityName) throws GenericEntityException; 73 74 GenericHelper getEntityHelper(ModelEntity entity) throws GenericEntityException; 75 76 ModelFieldType getEntityFieldType(ModelEntity entity, String type) throws GenericEntityException; 77 78 Collection getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException; 79 80 GenericValue makeValue(String entityName, Map fields); 81 82 GenericValue makeValidValue(String entityName, Map fields); 83 84 GenericPK makePK(String entityName, Map fields); 85 86 GenericValue create(String entityName, Map 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 entityName, Map fields) throws GenericEntityException; 105 106 GenericValue findByPrimaryKeyCache(String entityName, Map fields) throws GenericEntityException; 107 108 GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set keys) throws GenericEntityException; 109 110 List findAllByPrimaryKeys(Collection primaryKeys) throws GenericEntityException; 111 112 List findAllByPrimaryKeysCache(Collection 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 findAll(String entityName) throws GenericEntityException; 123 124 List findAll(String entityName, List orderBy) throws GenericEntityException; 125 126 List findAllCache(String entityName) throws GenericEntityException; 127 128 List findAllCache(String entityName, List orderBy) throws GenericEntityException; 129 130 List findByAnd(String entityName, Map fields) throws GenericEntityException; 131 132 List findByOr(String entityName, Map fields) throws GenericEntityException; 133 134 List findByAnd(String entityName, Map fields, List orderBy) throws GenericEntityException; 135 136 138 List findByOr(String entityName, Map fields, List orderBy) throws GenericEntityException; 139 140 List findByAndCache(String entityName, Map fields) throws GenericEntityException; 141 142 List findByAndCache(String entityName, Map fields, List orderBy) throws GenericEntityException; 143 144 List findByAnd(String entityName, List expressions) throws GenericEntityException; 145 146 List findByOr(String entityName, List expressions) throws GenericEntityException; 147 148 List findByAnd(String entityName, List expressions, List orderBy) throws GenericEntityException; 149 150 List findByOr(String entityName, List expressions, List orderBy) throws GenericEntityException; 151 152 List findByLike(String entityName, Map fields) throws GenericEntityException; 153 154 List findByLike(String entityName, Map fields, List orderBy) throws GenericEntityException; 155 156 List findByCondition(String entityName, EntityCondition entityCondition, Collection fieldsToSelect, List orderBy) throws GenericEntityException; 157 158 EntityListIterator findListIteratorByCondition(String entityName, EntityCondition entityCondition, 159 Collection fieldsToSelect, List orderBy) throws GenericEntityException; 160 161 EntityListIterator findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, 162 EntityCondition havingEntityCondition, Collection fieldsToSelect, List orderBy, EntityFindOptions findOptions) 163 throws GenericEntityException; 164 165 int removeByAnd(String entityName, Map fields) throws GenericEntityException; 166 167 int removeByAnd(String entityName, Map fields, boolean doCacheClear) throws GenericEntityException; 168 169 int removeByCondition(String entityName, EntityCondition condition) throws GenericEntityException; 170 171 int removeByCondition(String entityName, EntityCondition condition, boolean doCacheClear) throws GenericEntityException; 172 173 List getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List orderBy) throws GenericEntityException; 174 175 List getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo) throws GenericEntityException; 176 177 List getRelated(String relationName, GenericValue value) throws GenericEntityException; 178 179 List getRelatedByAnd(String relationName, Map byAndFields, GenericValue value) throws GenericEntityException; 180 181 List getRelatedOrderBy(String relationName, List orderBy, GenericValue value) throws GenericEntityException; 182 183 List getRelated(String relationName, Map byAndFields, List orderBy, GenericValue value) throws GenericEntityException; 184 185 GenericPK getRelatedDummyPK(String relationName, Map byAndFields, GenericValue value) throws GenericEntityException; 186 187 List getRelatedCache(String relationName, GenericValue value) throws GenericEntityException; 188 189 GenericValue getRelatedOne(String relationName, GenericValue value) throws GenericEntityException; 190 191 GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException; 192 193 int removeRelated(String relationName, GenericValue value) throws GenericEntityException; 194 195 int removeRelated(String 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 values) throws GenericEntityException; 206 207 int storeAll(List values, boolean doCacheClear) throws GenericEntityException; 208 209 int storeByCondition(String entityName, Map fieldsToSet, EntityCondition condition) throws GenericEntityException; 210 211 int storeByCondition(String entityName, Map fieldsToSet, EntityCondition condition, boolean doCacheClear) throws GenericEntityException; 212 213 int removeAll(List dummyPKs) throws GenericEntityException; 214 215 int removeAll(List dummyPKs, boolean doCacheClear) throws GenericEntityException; 216 217 void clearAllCaches(); 218 219 void clearAllCaches(boolean distribute); 220 221 void clearCacheLine(String entityName, Map 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 entityName, EntityCondition condition); 236 237 void clearAllCacheLinesByDummyPK(Collection dummyPKs); 238 239 void clearAllCacheLinesByValue(Collection values); 240 241 GenericValue getFromPrimaryKeyCache(GenericPK primaryKey); 242 243 String getNextSeqId(String seqName); 244 String getNextSeqId(String seqName, long staggerMax); 245 Long getNextSeqIdLong(String seqName); 246 Long getNextSeqIdLong(String seqName, long staggerMax); 247 248 void setSequencer(SequenceUtil sequencer); 249 250 void refreshSequencer(); 251 252 Cache getCache(); 253 } 254 | Popular Tags |