private List<GenericValue> filterByOrderBy(final List<GenericValue> allValues, final List<String> orderBy) { return (orderBy == null || orderBy.isEmpty()) ? allValues : EntityUtil.orderBy(allValues, orderBy); }
/** Get the named Related Entity for the GenericValue from the persistent * store and order it, looking first in a cache associated with this entity which is * destroyed with this ValueObject when no longer used. *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file *@param orderBy the order that they should be returned *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedOrderByEmbeddedCache(String relationName, List orderBy) throws GenericEntityException { return EntityUtil.orderBy(getRelatedEmbeddedCache(relationName), orderBy); }
/** * Get the named Related Entity for the GenericValue from the persistent * store and order it, looking first in a cache associated with this entity which is * destroyed with this ValueObject when no longer used. * * @param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param orderBy the order that they should be returned * @return List of GenericValue instances as specified in the relation definition */ public List<GenericValue> getRelatedOrderByEmbeddedCache(String relationName, List<String> orderBy) throws GenericEntityException { return EntityUtil.orderBy(getRelatedEmbeddedCache(relationName), orderBy); }
/** Get the named Related Entity for the GenericValue from the persistent * store and order it, looking first in a cache associated with this entity which is * destroyed with this ValueObject when no longer used. *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file *@param orderBy the order that they should be returned *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedOrderByEmbeddedCache(String relationName, List orderBy) throws GenericEntityException { return EntityUtil.orderBy(getRelatedEmbeddedCache(relationName), orderBy); }
@Override public List<GenericValue> findByAnd(final String s, final Map<String, ?> map, final List<String> orderClause) throws DataAccessException { final List<GenericValue> values = findByAnd(s, map); if (!orderClause.isEmpty()) { return EntityUtil.orderBy(values, orderClause); } else { return values; } }
private List<GenericValue> getAssociations(String associationName, Map<String, Object> fields, boolean useSequence) throws DataAccessException { List<GenericValue> result; result = ofBizDelegator.findByAnd(associationName, fields); if (result == null) return emptyList(); if (useSequence) { result = EntityUtil.orderBy(result, UtilMisc.toList("sequence")); } return result; }
/** * Get the named Related Entity for the GenericValue from the persistent * store and order it, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) * * @param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param orderBy the order that they should be returned * @return List of GenericValue instances as specified in the relation definition */ public List<GenericValue> getRelatedOrderByCache(String relationName, List<String> orderBy) throws GenericEntityException { return EntityUtil.orderBy(this.getDelegator().getRelatedCache(relationName, this), orderBy); }
/** Get the named Related Entity for the GenericValue from the persistent * store and order it, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file *@param orderBy the order that they should be returned *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedOrderByCache(String relationName, List orderBy) throws GenericEntityException { return EntityUtil.orderBy(this.getDelegator().getRelatedCache(relationName, this), orderBy); }
/** Get the named Related Entity for the GenericValue from the persistent * store and order it, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file *@param orderBy the order that they should be returned *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedOrderByCache(String relationName, List orderBy) throws GenericEntityException { return EntityUtil.orderBy(this.getDelegator().getRelatedCache(relationName, this), orderBy); }
/** Get the named Related Entity for the GenericValue from the persistent * store, looking first in a cache associated with this entity which is * destroyed with this ValueObject when no longer used. *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param byAndFields the fields that must equal in order to keep; may be null * @param orderBy The fields of the named entity to order the query by; may be null; * optionally add a " ASC" for ascending or " DESC" for descending *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedEmbeddedCache(String relationName, Map byAndFields, List orderBy) throws GenericEntityException { List col = getRelatedEmbeddedCache(relationName); if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields); if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy); return col; }
/** Get the named Related Entity for the GenericValue from the persistent * store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param byAndFields the fields that must equal in order to keep; may be null * @param orderBy The fields of the named entity to order the query by; may be null; * optionally add a " ASC" for ascending or " DESC" for descending *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedCache(String relationName, Map byAndFields, List orderBy) throws GenericEntityException { List col = getRelatedCache(relationName); if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields); if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy); return col; }
/** Get the named Related Entity for the GenericValue from the persistent * store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param byAndFields the fields that must equal in order to keep; may be null * @param orderBy The fields of the named entity to order the query by; may be null; * optionally add a " ASC" for ascending or " DESC" for descending *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedCache(String relationName, Map byAndFields, List orderBy) throws GenericEntityException { List col = getRelatedCache(relationName); if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields); if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy); return col; }
/** Get the named Related Entity for the GenericValue from the persistent * store, looking first in a cache associated with this entity which is * destroyed with this ValueObject when no longer used. *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param byAndFields the fields that must equal in order to keep; may be null * @param orderBy The fields of the named entity to order the query by; may be null; * optionally add a " ASC" for ascending or " DESC" for descending *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedEmbeddedCache(String relationName, Map byAndFields, List orderBy) throws GenericEntityException { List col = getRelatedEmbeddedCache(relationName); if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields); if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy); return col; }
/** * Get the named Related Entity for the GenericValue from the persistent * store, looking first in a cache associated with this entity which is * destroyed with this ValueObject when no longer used. * * @param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param byAndFields the fields that must equal in order to keep; may be null * @param orderBy The fields of the named entity to order the query by; may be null; * optionally add a " ASC" for ascending or " DESC" for descending * @return List of GenericValue instances as specified in the relation definition */ public List<GenericValue> getRelatedEmbeddedCache(String relationName, Map<String, ?> byAndFields, List<String> orderBy) throws GenericEntityException { List<GenericValue> col = getRelatedEmbeddedCache(relationName); if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields); if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy); return col; }
/** * Get the named Related Entity for the GenericValue from the persistent * store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) * * @param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file * @param byAndFields the fields that must equal in order to keep; may be null * @param orderBy The fields of the named entity to order the query by; may be null; * optionally add a " ASC" for ascending or " DESC" for descending * @return List of GenericValue instances as specified in the relation definition */ public List<GenericValue> getRelatedCache(String relationName, Map<String, ?> byAndFields, List<String> orderBy) throws GenericEntityException { List<GenericValue> col = getRelatedCache(relationName); if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields); if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy); return col; }