public void putAllInPrimaryKeyCache(List values) { if (values == null) return; Iterator iter = values.iterator(); while (iter.hasNext()) { GenericValue value = (GenericValue) iter.next(); this.putInPrimaryKeyCache(value.getPrimaryKey(), value); } }
public void putAllInPrimaryKeyCache(List values) { if (values == null) return; Iterator iter = values.iterator(); while (iter.hasNext()) { GenericValue value = (GenericValue) iter.next(); this.putInPrimaryKeyCache(value.getPrimaryKey(), value); } }
public GenericPK makePK(Element element) { GenericValue value = makeValue(element); return value.getPrimaryKey(); }
public GenericPK makePK(Element element) { GenericValue value = makeValue(element); return value.getPrimaryKey(); }
@SuppressWarnings("unused") public GenericPK makePK(final Element element) { checkIfLocked(); GenericValue value = makeValue(element); return value.getPrimaryKey(); }
public void putAllInPrimaryKeyCache(final List<? extends GenericValue> values) { checkIfLocked(); if (values == null) { return; } for (final GenericValue value : values) { putInPrimaryKeyCache(value.getPrimaryKey(), value); } }
/** Refresh the Entity for the GenericValue from the persistent store *@param value GenericValue instance containing the entity to refresh *@param doCacheClear boolean that specifies whether or not to automatically clear cache entries related to this operation */ public void refresh(GenericValue value, boolean doCacheClear) throws GenericEntityException { if (doCacheClear) { // always clear cache before the operation clearCacheLine(value); } GenericPK pk = value.getPrimaryKey(); GenericValue newValue = findByPrimaryKey(pk); if (newValue == null) { throw new IllegalArgumentException("[GenericDelegator.refresh] could not refresh value: " + value); } value.fields = newValue.fields; value.setDelegator(this); value.modified = false; }
/** Refresh the Entity for the GenericValue from the persistent store *@param value GenericValue instance containing the entity to refresh *@param doCacheClear boolean that specifies whether or not to automatically clear cache entries related to this operation */ public void refresh(GenericValue value, boolean doCacheClear) throws GenericEntityException { if (doCacheClear) { // always clear cache before the operation clearCacheLine(value); } GenericPK pk = value.getPrimaryKey(); GenericValue newValue = findByPrimaryKey(pk); if (newValue == null) { throw new IllegalArgumentException("[GenericDelegator.refresh] could not refresh value: " + value); } value.fields = newValue.fields; value.setDelegator(this); value.modified = false; }
private boolean addToCache(GenericValue value) { if (value == null) { return false; } if (!veryifyValue(value)) { return false; } value = (GenericValue) value.clone(); // we need to be sure that no-one accesses the underlying cache // between calling 'get' and 'put' synchronized (cache) { Map<GenericEntity, GenericValue> entityCache = cache.get(value.getEntityName()); if (entityCache == null) { entityCache = getNewCache(); cache.put(value.getEntityName(), entityCache); } entityCache.put(value.getPrimaryKey(), value); } return true; }
private boolean addToCache(GenericValue value) { if (value == null) { return false; } if (!veryifyValue(value)) { return false; } value = (GenericValue) value.clone(); // we need to be sure that no-one accesses the underlying cache // between calling 'get' and 'put' synchronized (cache) { Map entityCache = (Map) cache.get(value.getEntityName()); if (entityCache == null) { entityCache = getNewCache(); cache.put(value.getEntityName(), entityCache); } entityCache.put(value.getPrimaryKey(), value); } return true; }
private boolean addToCache(GenericValue value) { if (value == null) { return false; } if (!veryifyValue(value)) { return false; } value = (GenericValue) value.clone(); // we need to be sure that no-one accesses the underlying cache // between calling 'get' and 'put' synchronized (cache) { Map entityCache = (Map) cache.get(value.getEntityName()); if (entityCache == null) { entityCache = getNewCache(); cache.put(value.getEntityName(), entityCache); } entityCache.put(value.getPrimaryKey(), value); } return true; }
/** * Refresh the Entity for the GenericValue from the persistent store. * * @param value GenericValue instance containing the entity to refresh * @param doCacheClear whether to automatically clear cache entries related to this operation */ public void refresh(final GenericValue value, final boolean doCacheClear) throws GenericEntityException { checkIfLocked(); if (doCacheClear) { // always clear cache before the operation clearCacheLine(value); } GenericPK pk = value.getPrimaryKey(); GenericValue newValue = findByPrimaryKey(pk); if (newValue == null) { throw new IllegalArgumentException("[GenericDelegator.refresh] could not refresh value: " + value); } value.fields = newValue.fields; value.setDelegator(this); value.modified = false; }
/** * Remove a Generic Value from the database. * * @param value The GenericValue object of the entity to remove. * @param doCacheClear boolean that specifies whether to clear cache entries for this value to be removed * @return int representing number of rows affected by this operation */ public int removeValue(final GenericValue value, final boolean doCacheClear) throws GenericEntityException { checkIfLocked(); final GenericHelper helper = getEntityHelper(value.getEntityName()); if (doCacheClear) { clearCacheLine(value); } return helper.removeByPrimaryKey(value.getPrimaryKey()); }
primaryKeyCache.remove(value.getPrimaryKey());
primaryKeyCache.remove(value.getPrimaryKey());
primaryKeyCache.remove(value.getPrimaryKey());
/** Remove a Generic Value from the database *@param value The GenericValue object of the entity to remove. *@param doCacheClear boolean that specifies whether to clear cache entries for this value to be removed *@return int representing number of rows effected by this operation */ public int removeValue(GenericValue value, boolean doCacheClear) throws GenericEntityException { Map ecaEventMap = this.getEcaEntityEventMap(value.getEntityName()); this.evalEcaRules(EntityEcaHandler.EV_VALIDATE, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); GenericHelper helper = getEntityHelper(value.getEntityName()); if (doCacheClear) { this.evalEcaRules(EntityEcaHandler.EV_CACHE_CLEAR, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); this.clearCacheLine(value); } this.evalEcaRules(EntityEcaHandler.EV_RUN, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); int num = helper.removeByPrimaryKey(value.getPrimaryKey()); this.evalEcaRules(EntityEcaHandler.EV_RETURN, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); return num; }
/** Remove a Generic Value from the database *@param value The GenericValue object of the entity to remove. *@param doCacheClear boolean that specifies whether to clear cache entries for this value to be removed *@return int representing number of rows effected by this operation */ public int removeValue(GenericValue value, boolean doCacheClear) throws GenericEntityException { Map ecaEventMap = this.getEcaEntityEventMap(value.getEntityName()); this.evalEcaRules(EntityEcaHandler.EV_VALIDATE, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); GenericHelper helper = getEntityHelper(value.getEntityName()); if (doCacheClear) { this.evalEcaRules(EntityEcaHandler.EV_CACHE_CLEAR, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); this.clearCacheLine(value); } this.evalEcaRules(EntityEcaHandler.EV_RUN, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); int num = helper.removeByPrimaryKey(value.getPrimaryKey()); this.evalEcaRules(EntityEcaHandler.EV_RETURN, EntityEcaHandler.OP_REMOVE, value, ecaEventMap, (ecaEventMap == null), false); return num; }
updateIssueGV.setPKFields(iub.getChangedIssue().getPrimaryKey().getAllFields()); for (ChangeItemBean modifiedField : modifiedFields)