private EntityListIterator getListIterator(int pageNumber) throws GenericEntityException { GenericHelper helper = genericDelegator.getEntityHelper(entityName); ModelEntity modelEntity = genericDelegator.getModelEntity(entityName); EntityFindOptions entityFindOptions = new EntityFindOptions(); entityFindOptions.setOffset(pageNumber * pageSize); entityFindOptions.setMaxResults(pageSize); return helper.findListIteratorByCondition(modelEntity, entityCondition, null, null, orderBy, entityFindOptions); }
/** * Get the named Related Entity for the GenericValue from the persistent * store and filter 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 fields the fields that must equal in order to keep * @return List of GenericValue instances as specified in the relation definition */ public List<GenericValue> getRelatedByAndCache(String relationName, Map<String, ?> fields) throws GenericEntityException { return EntityUtil.filterByAnd(this.getDelegator().getRelatedCache(relationName, this), fields); }
/** 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); }
public ImmutableGenericValue(GenericDelegator delegator, String entityName, Map fields) { super(delegator.getModelEntity(entityName)); super.setDelegator(delegator); super.setFields(fields); constructed = true; }
public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) throws GenericEntityException { GenericValue value = findFromCache(primaryKey); value.setFields(value.getFields(keys)); return value; }
/** * Get a dummy primary key for the named Related Entity for the GenericValue * * @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 * @return GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities */ public GenericPK getRelatedDummyPK(String relationName) throws GenericEntityException { return this.getDelegator().getRelatedDummyPK(relationName, null, this); }
/** Finds Generic Entity records by all of the specified expressions (ie: combined using AND) *@param entityName The Name of the Entity as defined in the entity XML file *@param expressions The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to *@param orderBy The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending *@return List of GenericValue instances that match the query */ public List findByAnd(String entityName, List expressions, List orderBy) throws GenericEntityException { EntityConditionList ecl = new EntityConditionList(expressions, EntityOperator.AND); return findByCondition(entityName, ecl, null, orderBy); }
/** Get the named Related Entity for the GenericValue from the persistent store *@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 *@return List of GenericValue instances as specified in the relation definition */ public List getRelated(String relationName) throws GenericEntityException { return this.getDelegator().getRelated(relationName, this); }
/** Get the named Related Entity for the GenericValue from the persistent * store and filter 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 fields the fields that must equal in order to keep *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedByAndEmbeddedCache(String relationName, Map fields) throws GenericEntityException { return EntityUtil.filterByAnd(getRelatedEmbeddedCache(relationName), fields); }
/** 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 *@return List of GenericValue instances as specified in the relation definition */ public GenericValue getRelatedOneCache(String relationName) throws GenericEntityException { return this.getDelegator().getRelatedOneCache(relationName, this); }
/** * 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 * @return List of GenericValue instances as specified in the relation definition */ public List<GenericValue> getRelatedCache(String relationName) throws GenericEntityException { return this.getDelegator().getRelatedCache(relationName, this); }
/** Get the named Related Entity for the GenericValue from the persistent store *@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 *@return List of GenericValue instances as specified in the relation definition */ public GenericValue getRelatedOne(String relationName) throws GenericEntityException { return this.getDelegator().getRelatedOne(relationName, this); }
@Override public int compare(final GenericEntity d1, final GenericEntity d2) { return d1.getPrimaryKey().compareTo(d2.getPrimaryKey()); } });
/** Get the named Related Entity for the GenericValue from the persistent * store and filter 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 fields the fields that must equal in order to keep *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedByAndCache(String relationName, Map fields) throws GenericEntityException { return EntityUtil.filterByAnd(this.getDelegator().getRelatedCache(relationName, this), fields); }
/** * 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 a dummy primary key for the named Related Entity for the GenericValue * @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 * @return GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities */ public GenericPK getRelatedDummyPK(String relationName) throws GenericEntityException { return this.getDelegator().getRelatedDummyPK(relationName, null, this); }
/** 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 *@return List of GenericValue instances as specified in the relation definition */ public GenericValue getRelatedOneCache(String relationName) throws GenericEntityException { return this.getDelegator().getRelatedOneCache(relationName, this); }
/** Get the named Related Entity for the GenericValue from the persistent * store and filter 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 fields the fields that must equal in order to keep *@return List of GenericValue instances as specified in the relation definition */ public List getRelatedByAndCache(String relationName, Map fields) throws GenericEntityException { return EntityUtil.filterByAnd(this.getDelegator().getRelatedCache(relationName, this), fields); }
/** 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 a dummy primary key for the named Related Entity for the GenericValue * @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 * @return GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities */ public GenericPK getRelatedDummyPK(String relationName, Map byAndFields) throws GenericEntityException { return this.getDelegator().getRelatedDummyPK(relationName, byAndFields, this); }