| java.lang.Object org.ofbiz.entity.datasource.GenericHelperDAO
GenericHelperDAO | public class GenericHelperDAO implements GenericHelper(Code) | | Generic Entity Helper Class
|
Method Summary | |
public void | checkDataSource(Map modelEntities, List messages, boolean addMissing) | public GenericValue | create(GenericValue value) | public List | findAllByPrimaryKeys(List primaryKeys) Find a number of Generic Value objects by their Primary Keys, all at once
This is done here for the DAO GenericHelper; for a client-server helper it
would be done on the server side to reduce network round trips.
Parameters: primaryKeys - A List of primary keys to find by. | public List | findByMultiRelation(GenericValue value, ModelRelation modelRelationOne, ModelEntity modelEntityOne, ModelRelation modelRelationTwo, ModelEntity modelEntityTwo, List orderBy) | public GenericValue | findByPrimaryKey(GenericPK primaryKey) Find a Generic Entity by its Primary Key
Parameters: primaryKey - The primary key to find by. | public GenericValue | findByPrimaryKeyPartial(GenericPK primaryKey, Set keys) | public long | findCountByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions) | public EntityListIterator | findListIteratorByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection fieldsToSelect, List orderBy, EntityFindOptions findOptions) Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases) Parameters: havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases) Parameters: fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived Parameters: orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending Parameters: findOptions - An instance of EntityFindOptions that specifies advanced query options. | public String | getHelperName() | public int | removeByCondition(ModelEntity modelEntity, EntityCondition condition) | public int | removeByPrimaryKey(GenericPK primaryKey) Remove a Generic Entity corresponding to the primaryKey
Parameters: primaryKey - The primary key of the entity to remove. | public int | store(GenericValue value) | public int | storeByCondition(ModelEntity modelEntity, Map fieldsToSet, EntityCondition condition) Updates a group of values in a single pass. |
GenericHelperDAO | public GenericHelperDAO(String helperName)(Code) | | |
checkDataSource | public void checkDataSource(Map modelEntities, List messages, boolean addMissing) throws GenericEntityException(Code) | | Check the datasource to make sure the entity definitions are correct, optionally adding missing entities or fields on the server
Parameters: modelEntities - Map of entityName names and ModelEntity values Parameters: messages - List to put any result messages in Parameters: addMissing - Flag indicating whether or not to add missing entities and fields on the server |
findAllByPrimaryKeys | public List findAllByPrimaryKeys(List primaryKeys) throws GenericEntityException(Code) | | Find a number of Generic Value objects by their Primary Keys, all at once
This is done here for the DAO GenericHelper; for a client-server helper it
would be done on the server side to reduce network round trips.
Parameters: primaryKeys - A List of primary keys to find by. List of GenericValue objects corresponding to the passed primaryKey objects |
findByPrimaryKey | public GenericValue findByPrimaryKey(GenericPK primaryKey) throws GenericEntityException(Code) | | Find a Generic Entity by its Primary Key
Parameters: primaryKey - The primary key to find by. The GenericValue corresponding to the primaryKey |
findByPrimaryKeyPartial | public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set keys) throws GenericEntityException(Code) | | Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names)
Parameters: primaryKey - The primary key to find by. Parameters: keys - The keys, or names, of the values to retrieve; only these values will be retrieved The GenericValue corresponding to the primaryKey |
findListIteratorByCondition | public EntityListIterator findListIteratorByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection fieldsToSelect, List orderBy, EntityFindOptions findOptions) throws GenericEntityException(Code) | | Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases) Parameters: havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases) Parameters: fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived Parameters: orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending Parameters: findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details. EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED WHEN YOU AREDONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE CONNECTION. |
removeByCondition | public int removeByCondition(ModelEntity modelEntity, EntityCondition condition) throws GenericEntityException(Code) | | Removes/deletes Generic Entity records found by all the specified condition
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: condition - The condition that restricts the list of removed values int representing number of rows effected by this operation |
removeByPrimaryKey | public int removeByPrimaryKey(GenericPK primaryKey) throws GenericEntityException(Code) | | Remove a Generic Entity corresponding to the primaryKey
Parameters: primaryKey - The primary key of the entity to remove. int representing number of rows effected by this operation |
store | public int store(GenericValue value) throws GenericEntityException(Code) | | Store the Entity from the GenericValue to the persistent store
Parameters: value - GenericValue instance containing the entity int representing number of rows effected by this operation |
storeByCondition | public int storeByCondition(ModelEntity modelEntity, Map fieldsToSet, EntityCondition condition) throws GenericEntityException(Code) | | Updates a group of values in a single pass.
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: fieldsToSet - The fields of the named entity to set in the database Parameters: condition - The condition that restricts the list of removed values int representing number of rows effected by this operation throws: GenericEntityException - |
|
|