diff --git a/framework/entity/src/org/ofbiz/entity/GenericDelegator.java b/framework/entity/src/org/ofbiz/entity/GenericDelegator.java index bc9b1dece8..eeca594dda 100644 --- a/framework/entity/src/org/ofbiz/entity/GenericDelegator.java +++ b/framework/entity/src/org/ofbiz/entity/GenericDelegator.java @@ -1696,24 +1696,6 @@ public class GenericDelegator implements Delegator { return this.findList(entityName, ecl, null, null, null, false); } - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByOr(java.lang.String, java.lang.Object) - */ - @Deprecated - public List findByOr(String entityName, Object... fields) throws GenericEntityException { - EntityCondition ecl = EntityCondition.makeCondition(EntityOperator.OR, fields); - return this.findList(entityName, ecl, null, null, null, false); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByOr(java.lang.String, java.util.Map) - */ - @Deprecated - public List findByOr(String entityName, Map fields) throws GenericEntityException { - EntityCondition ecl = EntityCondition.makeCondition(fields, EntityOperator.OR); - return this.findList(entityName, ecl, null, null, null, false); - } - /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAnd(java.lang.String, java.util.Map, java.util.List) */ @@ -1722,23 +1704,6 @@ public class GenericDelegator implements Delegator { return this.findList(entityName, ecl, null, orderBy, null, false); } - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByOr(java.lang.String, java.util.Map, java.util.List) - */ - @Deprecated - public List findByOr(String entityName, Map fields, List orderBy) throws GenericEntityException { - EntityCondition ecl = EntityCondition.makeCondition(fields, EntityOperator.OR); - return this.findList(entityName, ecl, null, orderBy, null, false); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByAndCache(java.lang.String, java.lang.Object) - */ - @Deprecated - public List findByAndCache(String entityName, Object... fields) throws GenericEntityException { - return this.findByAndCache(entityName, UtilMisc.toMap(fields)); - } - /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAndCache(java.lang.String, java.util.Map) */ @@ -1753,124 +1718,6 @@ public class GenericDelegator implements Delegator { return this.findList(entityName, EntityCondition.makeCondition(fields), null, orderBy, null, true); } - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByLike(java.lang.String, java.lang.Object) - */ - @Deprecated - public List findByLike(String entityName, Object... fields) throws GenericEntityException { - Map fieldMap = UtilMisc.toMap(fields); - List likeExpressions = FastList.newInstance(); - if (fieldMap != null) { - for (Map.Entry fieldEntry: fieldMap.entrySet()) { - likeExpressions.add(EntityCondition.makeCondition(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue())); - } - } - EntityConditionList ecl = EntityCondition.makeCondition(likeExpressions, EntityOperator.AND); - return this.findList(entityName, ecl, null, null, null, false); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByLike(java.lang.String, java.util.Map) - */ - @Deprecated - public List findByLike(String entityName, Map fields) throws GenericEntityException { - List likeExpressions = FastList.newInstance(); - if (fields != null) { - for (Map.Entry fieldEntry: fields.entrySet()) { - likeExpressions.add(EntityCondition.makeCondition(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue())); - } - } - EntityConditionList ecl = EntityCondition.makeCondition(likeExpressions, EntityOperator.AND); - return this.findList(entityName, ecl, null, null, null, false); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByLike(java.lang.String, java.util.Map, java.util.List) - */ - @Deprecated - public List findByLike(String entityName, Map fields, List orderBy) throws GenericEntityException { - List likeExpressions = FastList.newInstance(); - if (fields != null) { - for (Map.Entry fieldEntry: fields.entrySet()) { - likeExpressions.add(EntityCondition.makeCondition(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue())); - } - } - EntityConditionList ecl = EntityCondition.makeCondition(likeExpressions, EntityOperator.AND); - return this.findList(entityName, ecl, null, orderBy, null, false); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByCondition(java.lang.String, org.ofbiz.entity.condition.EntityCondition, java.util.Collection, java.util.List) - */ - @Deprecated - public List findByCondition(String entityName, EntityCondition entityCondition, Collection fieldsToSelect, List orderBy) throws GenericEntityException { - return this.findList(entityName, entityCondition, UtilMisc.toSet(fieldsToSelect), orderBy, null, false); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByCondition(java.lang.String, org.ofbiz.entity.condition.EntityCondition, org.ofbiz.entity.condition.EntityCondition, java.util.Collection, java.util.List, org.ofbiz.entity.util.EntityFindOptions) - */ - @Deprecated - public List findByCondition(String entityName, EntityCondition whereEntityCondition, - EntityCondition havingEntityCondition, Collection fieldsToSelect, List orderBy, EntityFindOptions findOptions) - throws GenericEntityException { - boolean beganTransaction = false; - try { - if (alwaysUseTransaction) { - beganTransaction = TransactionUtil.begin(); - } - - EntityListIterator eli = this.find(entityName, whereEntityCondition, havingEntityCondition, UtilMisc.toSet(fieldsToSelect), orderBy, findOptions); - eli.setDelegator(this); - List list = eli.getCompleteList(); - eli.close(); - - return list; - } catch (GenericEntityException e) { - String errMsg = "Failure in findByCondition operation for entity [" + entityName + "]: " + e.toString() + ". Rolling back transaction."; - Debug.logError(e, errMsg, module); - try { - // only rollback the transaction if we started one... - TransactionUtil.rollback(beganTransaction, errMsg, e); - } catch (GenericEntityException e2) { - Debug.logError(e2, "[GenericDelegator] Could not rollback transaction: " + e2.toString(), module); - } - // after rolling back, rethrow the exception - throw e; - } finally { - // only commit the transaction if we started one... this will throw an exception if it fails - TransactionUtil.commit(beganTransaction); - } - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findByConditionCache(java.lang.String, org.ofbiz.entity.condition.EntityCondition, java.util.Collection, java.util.List) - */ - @Deprecated - public List findByConditionCache(String entityName, EntityCondition entityCondition, Collection fieldsToSelect, List orderBy) throws GenericEntityException { - return this.findList(entityName, entityCondition, UtilMisc.collectionToSet(fieldsToSelect), orderBy, null, true); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findListIteratorByCondition(java.lang.String, org.ofbiz.entity.condition.EntityCondition, java.util.Collection, java.util.List) - */ - @Deprecated - public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition entityCondition, - Collection fieldsToSelect, List orderBy) throws GenericEntityException { - return this.find(entityName, entityCondition, null, UtilMisc.collectionToSet(fieldsToSelect), orderBy, null); - } - - /* (non-Javadoc) - * @see org.ofbiz.entity.Delegator#findListIteratorByCondition(java.lang.String, org.ofbiz.entity.condition.EntityCondition, org.ofbiz.entity.condition.EntityCondition, java.util.Collection, java.util.List, org.ofbiz.entity.util.EntityFindOptions) - */ - @Deprecated - public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, - EntityCondition havingEntityCondition, Collection fieldsToSelect, List orderBy, EntityFindOptions findOptions) - throws GenericEntityException { - - return this.find(entityName, whereEntityCondition, havingEntityCondition, UtilMisc.collectionToSet(fieldsToSelect), orderBy, findOptions); - } - /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#find(java.lang.String, org.ofbiz.entity.condition.EntityCondition, org.ofbiz.entity.condition.EntityCondition, java.util.Set, java.util.List, org.ofbiz.entity.util.EntityFindOptions) */