|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.entity.datasource.GenericHelperDAO
public class GenericHelperDAO
Generic Entity Helper Class
Field Summary | |
---|---|
protected GenericDAO |
genericDAO
|
protected java.lang.String |
helperName
|
static java.lang.String |
module
|
Constructor Summary | |
---|---|
GenericHelperDAO(java.lang.String helperName)
|
Method Summary | |
---|---|
void |
checkDataSource(java.util.Map<java.lang.String,ModelEntity> modelEntities,
java.util.List<java.lang.String> messages,
boolean addMissing)
Check the datasource to make sure the entity definitions are correct, optionally adding missing entities or fields on the server |
GenericValue |
create(GenericValue value)
Creates a Entity in the form of a GenericValue and write it to the database |
java.util.List<GenericValue> |
findAllByPrimaryKeys(java.util.List<GenericPK> 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. |
java.util.List<GenericValue> |
findByMultiRelation(GenericValue value,
ModelRelation modelRelationOne,
ModelEntity modelEntityOne,
ModelRelation modelRelationTwo,
ModelEntity modelEntityTwo,
java.util.List<java.lang.String> orderBy)
|
GenericValue |
findByPrimaryKey(GenericPK primaryKey)
Find a Generic Entity by its Primary Key |
GenericValue |
findByPrimaryKeyPartial(GenericPK primaryKey,
java.util.Set<java.lang.String> keys)
Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names) |
long |
findCountByCondition(ModelEntity modelEntity,
EntityCondition whereEntityCondition,
EntityCondition havingEntityCondition,
EntityFindOptions findOptions)
|
EntityListIterator |
findListIteratorByCondition(ModelEntity modelEntity,
EntityCondition whereEntityCondition,
EntityCondition havingEntityCondition,
java.util.Collection<java.lang.String> fieldsToSelect,
java.util.List<java.lang.String> orderBy,
EntityFindOptions findOptions)
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. |
java.lang.String |
getHelperName()
Gets the name of the server configuration that corresponds to this helper |
int |
removeByCondition(ModelEntity modelEntity,
EntityCondition condition)
Removes/deletes Generic Entity records found by all the specified condition |
int |
removeByPrimaryKey(GenericPK primaryKey)
Remove a Generic Entity corresponding to the primaryKey |
int |
store(GenericValue value)
Store the Entity from the GenericValue to the persistent store |
int |
storeByCondition(ModelEntity modelEntity,
java.util.Map<java.lang.String,? extends java.lang.Object> fieldsToSet,
EntityCondition condition)
Updates a group of values in a single pass. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String module
protected GenericDAO genericDAO
protected java.lang.String helperName
Constructor Detail |
---|
public GenericHelperDAO(java.lang.String helperName)
Method Detail |
---|
public java.lang.String getHelperName()
GenericHelper
getHelperName
in interface GenericHelper
public GenericValue create(GenericValue value) throws GenericEntityException
create
in interface GenericHelper
GenericEntityException
public GenericValue findByPrimaryKey(GenericPK primaryKey) throws GenericEntityException
findByPrimaryKey
in interface GenericHelper
primaryKey
- The primary key to find by.
GenericEntityException
public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, java.util.Set<java.lang.String> keys) throws GenericEntityException
findByPrimaryKeyPartial
in interface GenericHelper
primaryKey
- The primary key to find by.keys
- The keys, or names, of the values to retrieve; only these values will be retrieved
GenericEntityException
public java.util.List<GenericValue> findAllByPrimaryKeys(java.util.List<GenericPK> primaryKeys) throws GenericEntityException
findAllByPrimaryKeys
in interface GenericHelper
primaryKeys
- A List of primary keys to find by.
GenericEntityException
public int removeByPrimaryKey(GenericPK primaryKey) throws GenericEntityException
removeByPrimaryKey
in interface GenericHelper
primaryKey
- The primary key of the entity to remove.
GenericEntityException
public EntityListIterator findListIteratorByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy, EntityFindOptions findOptions) throws GenericEntityException
findListIteratorByCondition
in interface GenericHelper
modelEntity
- The ModelEntity of the Entity as defined in the entity XML filewhereEntityCondition
- 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)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)fieldsToSelect
- The fields of the named entity to get from the database; if empty or null all fields will be retreivedorderBy
- The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descendingfindOptions
- An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
GenericEntityException
public java.util.List<GenericValue> findByMultiRelation(GenericValue value, ModelRelation modelRelationOne, ModelEntity modelEntityOne, ModelRelation modelRelationTwo, ModelEntity modelEntityTwo, java.util.List<java.lang.String> orderBy) throws GenericEntityException
findByMultiRelation
in interface GenericHelper
GenericEntityException
public long findCountByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions) throws GenericEntityException
findCountByCondition
in interface GenericHelper
GenericEntityException
public int removeByCondition(ModelEntity modelEntity, EntityCondition condition) throws GenericEntityException
removeByCondition
in interface GenericHelper
modelEntity
- The ModelEntity of the Entity as defined in the entity XML filecondition
- The condition that restricts the list of removed values
GenericEntityException
public int store(GenericValue value) throws GenericEntityException
store
in interface GenericHelper
value
- GenericValue instance containing the entity
GenericEntityException
public int storeByCondition(ModelEntity modelEntity, java.util.Map<java.lang.String,? extends java.lang.Object> fieldsToSet, EntityCondition condition) throws GenericEntityException
storeByCondition
in interface GenericHelper
modelEntity
- The ModelEntity of the Entity as defined in the entity XML filefieldsToSet
- The fields of the named entity to set in the databasecondition
- The condition that restricts the list of removed values
GenericEntityException
public void checkDataSource(java.util.Map<java.lang.String,ModelEntity> modelEntities, java.util.List<java.lang.String> messages, boolean addMissing) throws GenericEntityException
checkDataSource
in interface GenericHelper
modelEntities
- Map of entityName names and ModelEntity valuesmessages
- List to put any result messages inaddMissing
- Flag indicating whether or not to add missing entities and fields on the server
GenericEntityException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |