public int removeByAnd(ModelEntity modelEntity, Map fields) throws GenericEntityException { Map entityCache = (Map) cache.get(modelEntity.getEntityName()); if (entityCache == null) { return 0; } ArrayList removeList = new ArrayList(); for (Iterator iterator = entityCache.entrySet().iterator(); iterator.hasNext();) { Map.Entry mapEntry = (Map.Entry) iterator.next(); GenericValue value = (GenericValue) mapEntry.getValue(); if (isAndMatch(value.fields, fields)) { removeList.add(mapEntry.getKey()); } } return removeAll(removeList); }
public int removeByAnd(ModelEntity modelEntity, Map<String, ?> fields) throws GenericEntityException { Map<GenericEntity, GenericValue> entityCache = cache.get(modelEntity.getEntityName()); if (entityCache == null) { return 0; } ArrayList<GenericEntity> removeList = new ArrayList<GenericEntity>(); for (Map.Entry<GenericEntity, GenericValue> mapEntry : entityCache.entrySet()) { GenericValue value = mapEntry.getValue(); if (isAndMatch(value.fields, fields)) { removeList.add(mapEntry.getKey()); } } return removeAll(removeList); }
public int removeByAnd(ModelEntity modelEntity, Map fields) throws GenericEntityException { Map entityCache = (Map) cache.get(modelEntity.getEntityName()); if (entityCache == null) { return 0; } ArrayList removeList = new ArrayList(); for (Iterator iterator = entityCache.entrySet().iterator(); iterator.hasNext();) { Map.Entry mapEntry = (Map.Entry) iterator.next(); GenericValue value = (GenericValue) mapEntry.getValue(); if (isAndMatch(value.fields, fields)) { removeList.add(mapEntry.getKey()); } } return removeAll(removeList); }
public int removeByCondition(final ModelEntity modelEntity, final EntityCondition whereCondition) throws GenericEntityException { Map<GenericEntity, GenericValue> entityCache = cache.get(modelEntity.getEntityName()); if (entityCache == null) { return 0; } List<GenericValue> foundValues = findByCondition(modelEntity, whereCondition, null, null); return removeAll(foundValues); }