| java.lang.Object org.ofbiz.entity.datasource.GenericHelperDAO
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 | findByAnd(ModelEntity modelEntity, Map fields, List orderBy) | public List | findByCondition(ModelEntity modelEntity, EntityCondition entityCondition, Collection fieldsToSelect, List orderBy) Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. | public List | findByMultiRelation(GenericValue value, ModelRelation modelRelationOne, ModelEntity modelEntityOne, ModelRelation modelRelationTwo, ModelEntity modelEntityTwo, List orderBy) | public List | findByOr(ModelEntity modelEntity, Map fields, 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) | 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 | removeAll(List dummyPKs) Remove the Entities from the List from the persistent store. | public int | removeByAnd(ModelEntity modelEntity, Map fields) | 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 | storeAll(List values) Store the Entities from the List GenericValue instances to the persistent store.
This is different than the normal store method in that the store method only does
an update, while the storeAll method checks to see if each entity exists, then
either does an insert or an update as appropriate.
These updates all happen in one transaction, so they will either all succeed or all fail,
if the data source supports transactions. |
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 |
findByAnd | public List findByAnd(ModelEntity modelEntity, Map fields, List orderBy) throws GenericEntityException(Code) | | Finds Generic Entity records by all of the specified fields (ie: combined using AND)
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: fields - The fields of the named entity to query by with their corresponging values Parameters: orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending List of GenericValue instances that match the query |
findByCondition | public List findByCondition(ModelEntity modelEntity, EntityCondition entityCondition, Collection fieldsToSelect, List orderBy) 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: entityCondition - The EntityCondition object that specifies how to constrain this query 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 List of GenericValue objects representing the result |
findByOr | public List findByOr(ModelEntity modelEntity, Map fields, List orderBy) throws GenericEntityException(Code) | | Finds Generic Entity records by all of the specified fields (ie: combined using OR)
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: fields - The fields of the named entity to query by with their corresponging values Parameters: orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending List of GenericValue instances that match the query |
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. |
removeAll | public int removeAll(List dummyPKs) throws GenericEntityException(Code) | | Remove the Entities from the List from the persistent store.
The List contains GenericEntity objects, can be either GenericPK or GenericValue.
If a certain entity contains a complete primary key, the entity in the datasource corresponding
to that primary key will be removed, this is like a removeByPrimary Key.
On the other hand, if a certain entity is an incomplete or non primary key,
if will behave like the removeByAnd method.
These updates all happen in one transaction, so they will either all succeed or all fail,
if the data source supports transactions.
Parameters: dummyPKs - List of GenericEntity instances containing the entities or by and fields to remove int representing number of rows effected by this operation |
removeByAnd | public int removeByAnd(ModelEntity modelEntity, Map fields) throws GenericEntityException(Code) | | Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)
Parameters: modelEntity - The ModelEntity of the Entity as defined in the entity XML file Parameters: fields - The fields of the named entity to query by with their corresponging 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 |
storeAll | public int storeAll(List values) throws GenericEntityException(Code) | | Store the Entities from the List GenericValue instances to the persistent store.
This is different than the normal store method in that the store method only does
an update, while the storeAll method checks to see if each entity exists, then
either does an insert or an update as appropriate.
These updates all happen in one transaction, so they will either all succeed or all fail,
if the data source supports transactions. This is just like to othersToStore feature
of the GenericEntity on a create or store.
Parameters: values - List of GenericValue instances containing the entities to store int representing number of rows effected by this operation |
|
|