Class MockOfBizDelegator
- All Implemented Interfaces:
OfBizDelegator
The constructor accepts two lists. The genericValues list can be used to pre-populate the in-memory database with GenericValue objects required for the test. It represents the initial state of the database.
The expectedGenericValues list represents the final state of the database. It can be used to verify the final contents of the in-memory database upon test completion.
It is possible to verify the final contents of the in-memory database with the expectedGenericValues list through the methods
verify()
(verify objects in expectedGenericValues exist in database) and verifyAll()
(verify
objects in expectedGenericValues and only those objects exist in database).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<org.ofbiz.core.entity.GenericValue>
static final int
Fields inherited from interface com.atlassian.jira.ofbiz.OfBizDelegator
ISSUE_LINK, ISSUE_LINK_TYPE, PROJECT_COMPONENT, VERSION
-
Constructor Summary
ConstructorsConstructorDescriptionMockOfBizDelegator
(List<? extends org.ofbiz.core.entity.GenericValue> genericValues, List<? extends org.ofbiz.core.entity.GenericValue> expectedGenericValues) Creates new instance of MockOfBizDelegator.MockOfBizDelegator
(org.ofbiz.core.entity.DelegatorInterface delegatorInterface) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRelatedMap
(String relationName, org.ofbiz.core.entity.GenericValue gv, List<org.ofbiz.core.entity.GenericValue> listToReturn) void
addRelatedMap
(String relationName, org.ofbiz.core.entity.GenericValue gv, org.ofbiz.core.entity.GenericValue... gvsToReturns) int
bulkCopyColumnValuesByAnd
(String entityName, Map updateColumns, Map criteria) This can be used to perform an update on the entityName of all the rows identified by AND criteria of the fields specified by the criteria map.int
This can be used to perform an update on the entityName of all the rows identified by AND criteria of the fields specified by the criteria map.int
This can be used to perform an update on the entityName of all the rows identified by the keys with the values stored in the updateValues.void
clear()
Removes all values from the "database".org.ofbiz.core.entity.GenericValue
createValue
(String entity, Map<String, Object> params) Creates a new GenericValue, and persists it.void
createValue
(org.ofbiz.core.entity.GenericValue entity) void
createValueWithoutId
(String entityName, Map<String, Object> fields) Creates a new GenericValue, and persists it without trying to automatically populate the ID column.List<org.ofbiz.core.entity.GenericValue>
List<org.ofbiz.core.entity.GenericValue>
List<org.ofbiz.core.entity.GenericValue>
List<org.ofbiz.core.entity.GenericValue>
Finds GenericValue records by all of the specified fields (ie: combined using AND).List<org.ofbiz.core.entity.GenericValue>
List<org.ofbiz.core.entity.GenericValue>
findByCondition
(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, Collection<String> fieldsToSelect) Finds GenericValues by the conditions specified in the EntityCondition object with no specified order.List<org.ofbiz.core.entity.GenericValue>
findByCondition
(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) Finds GenericValues by the conditions specified in the EntityCondition object.List<org.ofbiz.core.entity.GenericValue>
findByField
(String entityName, String fieldName, Object fieldValue) Finds GenericValue records by the specified field value.List<org.ofbiz.core.entity.GenericValue>
findByField
(String entityName, String fieldName, Object fieldValue, String orderBy) Finds GenericValue records by the specified field value.org.ofbiz.core.entity.GenericValue
Find a Generic Entity by its numeric ID.List<org.ofbiz.core.entity.GenericValue>
findByLike
(String entityName, Map<String, ?> map) List<org.ofbiz.core.entity.GenericValue>
List<org.ofbiz.core.entity.GenericValue>
findByOr
(String entityName, List<? extends org.ofbiz.core.entity.EntityCondition> expressions, List<String> orderBy) org.ofbiz.core.entity.GenericValue
findByPrimaryKey
(String entityName, Long id) Find a Generic Entity by its single numeric Primary Key.org.ofbiz.core.entity.GenericValue
findByPrimaryKey
(String s, Map<String, ?> map) Find a Generic Entity by its Primary Key.findListIteratorByCondition
(String entityType, org.ofbiz.core.entity.EntityCondition condition) Returns a new OfBizListIterator.findListIteratorByCondition
(String entityName, org.ofbiz.core.entity.EntityCondition whereEntityCondition, org.ofbiz.core.entity.EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, org.ofbiz.core.entity.EntityFindOptions entityFindOptions) Returns a new OfBizListIterator.long
Runs aCOUNT *
query over the given entity.long
getCountByAnd
(String entityName, Map<String, ?> fields) Runs aCOUNT *
query over the given entity with someWHERE
conditions.long
getCountByAnd
(String entityName, org.ofbiz.core.entity.EntityCondition condition) Runs aCOUNT *
query over the given entity with someWHERE
conditions.org.ofbiz.core.entity.DelegatorInterface
Returns the underlying raw Entity Engine DelegatorInterface.org.ofbiz.core.entity.model.ModelReader
Returns a model reader that can be used to retrieve all the different entitynames configured in the entitymodel.List<org.ofbiz.core.entity.GenericValue>
getRelated
(String relationName, org.ofbiz.core.entity.GenericValue gv) List<org.ofbiz.core.entity.GenericValue>
getRelated
(String relationName, org.ofbiz.core.entity.GenericValue gv, List<String> orderBy) org.ofbiz.core.entity.GenericValue
Creates an Entity in the form of a GenericValue without persisting it.org.ofbiz.core.entity.GenericValue
Creates an Entity in the form of a GenericValue without persisting it.void
Refreshes the sequencer that is used to retrieve unique IDs in the database.void
int
removeByAnd
(String s, Map<String, ?> map) int
removeByCondition
(String entityName, org.ofbiz.core.entity.EntityCondition condition) int
removeById
(String entityName, Long id) Remove the given entity from the DB.int
removeByOr
(String entityName, String entityId, List<Long> ids) This can be used to remove rows for a given entity based onentityName
and whereentityId</q
boolean
removeRelated
(String relationName, org.ofbiz.core.entity.GenericValue schemeGv) Remove all the entities related to the passed generic value via the passed relationship name.int
removeValue
(org.ofbiz.core.entity.GenericValue value) void
setGenericValues
(List<? extends org.ofbiz.core.entity.GenericValue> genericValues) void
setModelReader
(org.ofbiz.core.entity.model.ModelReader modelReader) void
store
(org.ofbiz.core.entity.GenericValue gv) void
toString()
List<org.ofbiz.core.entity.GenericValue>
transform
(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, List<String> orderBy, String lockField, org.ofbiz.core.entity.Transformation transformation) Applies the given transformation to any entities matching the given condition.org.ofbiz.core.entity.GenericValue
transformOne
(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, String lockField, org.ofbiz.core.entity.Transformation transformation) Applies the given transformation to the entity matching the given condition.void
verify()
Look through all the fields that are expected, and checks that they have the correct values.void
Look through all the fields that are expected, and checks that they have the correct values.void
verify
(org.ofbiz.core.entity.GenericValue... expectedGenericValues) void
Look through all the fields that are expected, and checks that they have the correct values.void
Look through all the fields that are expected, and checks that they have the correct values.void
verifyAll
(org.ofbiz.core.entity.GenericValue... expectedGenericValues)
-
Field Details
-
STARTING_ID
public static final int STARTING_ID- See Also:
-
GV_ENTITY_NAME_AND_ID_COMPARATOR
-
-
Constructor Details
-
MockOfBizDelegator
public MockOfBizDelegator() -
MockOfBizDelegator
public MockOfBizDelegator(List<? extends org.ofbiz.core.entity.GenericValue> genericValues, List<? extends org.ofbiz.core.entity.GenericValue> expectedGenericValues) Creates new instance of MockOfBizDelegator. The genericValues list can be used to pre-populate the in-memory database with GenericValue objects required for the test. It represents the initial state of the database.The expectedGenericValues list represents a list objects that should exist in the final state of the database. It can be used to verify the final contents of the in-memory database upon test completion.
- Parameters:
genericValues
- a list of GenericValue objects that represents the initial state of the databaseexpectedGenericValues
- a list of GenericValue objects that represents the objects that should exist in the final state of the database - it will be a complete list forverifyAll()
verification and a subset forverify()
method. It may help readability to specify this information directly in theverify(List)
orverifyAll(List)
instead of providing it here.
-
MockOfBizDelegator
public MockOfBizDelegator(org.ofbiz.core.entity.DelegatorInterface delegatorInterface)
-
-
Method Details
-
findByField
public List<org.ofbiz.core.entity.GenericValue> findByField(String entityName, String fieldName, Object fieldValue) Description copied from interface:OfBizDelegator
Finds GenericValue records by the specified field value.- Specified by:
findByField
in interfaceOfBizDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefieldName
- The field to do filtering by.fieldValue
- The desired value for the filtering field.- Returns:
- List of GenericValue instances that match the query
-
findByField
public List<org.ofbiz.core.entity.GenericValue> findByField(String entityName, String fieldName, Object fieldValue, String orderBy) Description copied from interface:OfBizDelegator
Finds GenericValue records by the specified field value.- Specified by:
findByField
in interfaceOfBizDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefieldName
- The field to do filtering by.fieldValue
- The desired value for the filtering field.orderBy
- Single field to order by.- Returns:
- List of GenericValue instances that match the query
-
setGenericValues
-
findByAnd
public List<org.ofbiz.core.entity.GenericValue> findByAnd(String s, Map<String, ?> map) throws DataAccessExceptionDescription copied from interface:OfBizDelegator
Finds GenericValue records by all of the specified fields (ie: combined using AND).- Specified by:
findByAnd
in interfaceOfBizDelegator
- Parameters:
s
- The Name of the Entity as defined in the entity XML filemap
- The fields of the named entity to query by with their corresponding values- Returns:
- List of GenericValue instances that match the query
- Throws:
DataAccessException
- If an error occurs in the persistence layer.
-
findByAnd
public List<org.ofbiz.core.entity.GenericValue> findByAnd(String s, Map<String, ?> map, List<String> orderClause) throws DataAccessException- Specified by:
findByAnd
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
findByAnd
public List<org.ofbiz.core.entity.GenericValue> findByAnd(String s, List<org.ofbiz.core.entity.EntityCondition> expressions) throws DataAccessException - Specified by:
findByAnd
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
findByOr
public List<org.ofbiz.core.entity.GenericValue> findByOr(String entityName, List<? extends org.ofbiz.core.entity.EntityCondition> expressions, List<String> orderBy) throws DataAccessException - Specified by:
findByOr
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
findByLike
public List<org.ofbiz.core.entity.GenericValue> findByLike(String entityName, Map<String, ?> map, List<String> orderBy) throws DataAccessException- Specified by:
findByLike
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
findByLike
public List<org.ofbiz.core.entity.GenericValue> findByLike(String entityName, Map<String, ?> map) throws DataAccessException- Specified by:
findByLike
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
removeAll
public void removeAll(List<org.ofbiz.core.entity.GenericValue> genericValues) throws DataAccessException - Specified by:
removeAll
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
removeByAnd
- Specified by:
removeByAnd
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
removeByCondition
public int removeByCondition(String entityName, org.ofbiz.core.entity.EntityCondition condition) throws DataAccessException - Specified by:
removeByCondition
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
removeById
Description copied from interface:OfBizDelegator
Remove the given entity from the DB.- Specified by:
removeById
in interfaceOfBizDelegator
- Parameters:
entityName
- the entity type (ie TABLE)id
- the id of the row to delete.- Returns:
- number of rows effected by this operation
-
removeValue
public int removeValue(org.ofbiz.core.entity.GenericValue value) - Specified by:
removeValue
in interfaceOfBizDelegator
-
storeAll
public void storeAll(List<org.ofbiz.core.entity.GenericValue> genericValues) throws DataAccessException - Specified by:
storeAll
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
findAll
- Specified by:
findAll
in interfaceOfBizDelegator
-
findAll
public List<org.ofbiz.core.entity.GenericValue> findAll(String s, List<String> sortOrder) throws DataAccessException - Specified by:
findAll
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
store
- Specified by:
store
in interfaceOfBizDelegator
- Throws:
DataAccessException
-
createValue
public void createValue(org.ofbiz.core.entity.GenericValue entity) -
createValue
public org.ofbiz.core.entity.GenericValue createValue(String entity, Map<String, Object> params) throws DataAccessExceptionDescription copied from interface:OfBizDelegator
Creates a new GenericValue, and persists it.If there is no "id" in the field values, one is created using the entity sequence.
- Specified by:
createValue
in interfaceOfBizDelegator
- Parameters:
entity
- the entity name.params
- field values- Returns:
- The new GenericValue.
- Throws:
DataAccessException
- if an error occurs in the Database layer- See Also:
-
createValueWithoutId
Description copied from interface:OfBizDelegator
Creates a new GenericValue, and persists it without trying to automatically populate the ID column.Use this for entities that don't have a numeric ID column.
- Specified by:
createValueWithoutId
in interfaceOfBizDelegator
- Parameters:
entityName
- the entity name.fields
- field values- See Also:
-
makeValue
Description copied from interface:OfBizDelegator
Creates an Entity in the form of a GenericValue without persisting it.- Specified by:
makeValue
in interfaceOfBizDelegator
- Parameters:
entity
- the entity name.- Returns:
- The new GenericValue.
- See Also:
-
makeValue
Description copied from interface:OfBizDelegator
Creates an Entity in the form of a GenericValue without persisting it.- Specified by:
makeValue
in interfaceOfBizDelegator
- Parameters:
entityName
- the entity name.fields
- initial field values- Returns:
- The new GenericValue.
- See Also:
-
findById
public org.ofbiz.core.entity.GenericValue findById(String entityName, Long id) throws DataAccessException Description copied from interface:OfBizDelegator
Find a Generic Entity by its numeric ID.This method is a synonym for
OfBizDelegator.findByPrimaryKey(String, Long)
- Specified by:
findById
in interfaceOfBizDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML fileid
- The numeric "id" field value that is the primary key of this entity.- Returns:
- The GenericValue corresponding to the ID
- Throws:
DataAccessException
- DataAccessException
-
findByPrimaryKey
Description copied from interface:OfBizDelegator
Find a Generic Entity by its single numeric Primary Key.This method is a convenience for entities with a numeric primary key on single field called "id". This is the case for most JIRA entities.
- Specified by:
findByPrimaryKey
in interfaceOfBizDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML fileid
- The numeric "id" field value that is the primary key of this entity.- Returns:
- The GenericValue corresponding to the primary key
- See Also:
-
findByPrimaryKey
Description copied from interface:OfBizDelegator
Find a Generic Entity by its Primary Key.- Specified by:
findByPrimaryKey
in interfaceOfBizDelegator
- Parameters:
s
- The Name of the Entity as defined in the entity XML filemap
- The field/value pairs of the primary key (in JIRA, mostly just a single field "id")- Returns:
- The GenericValue corresponding to the primary key
- See Also:
-
getRelated
public List<org.ofbiz.core.entity.GenericValue> getRelated(String relationName, org.ofbiz.core.entity.GenericValue gv) - Specified by:
getRelated
in interfaceOfBizDelegator
-
getRelated
public List<org.ofbiz.core.entity.GenericValue> getRelated(String relationName, org.ofbiz.core.entity.GenericValue gv, List<String> orderBy) - Specified by:
getRelated
in interfaceOfBizDelegator
-
getCount
Description copied from interface:OfBizDelegator
Runs aCOUNT *
query over the given entity.Ensure that there is a view-entity defined in
entitymodel.xml
andentitygroup.xml
for the entity you are calling this method with, and that the view-entity is named correctly! The view-entity must be named the name of the normal entity with"Count"
appended. For example, for the"Issue"
entity, the view-entity must be called"IssueCount"
. Otherwise an exception will be thrown.For JIRA core developers, see
EntityEngine
'sSelect
factory for a more flexible alternative, including the ability to terminate queries with.count()
instead of.asList()
to accomplish a count without creating a special view entity for that purpose. For app developers, this can only be done directly through the lower levelDelegatorInterface
at this time.- Specified by:
getCount
in interfaceOfBizDelegator
- Parameters:
entityName
- entity name- Returns:
- count
-
getCountByAnd
Description copied from interface:OfBizDelegator
Runs aCOUNT *
query over the given entity with someWHERE
conditions.In addition to the restrictions given for
OfBizDelegator.getCount(String)
, the view-entity will need to define any columns that you wish to use in the where clause.- Specified by:
getCountByAnd
in interfaceOfBizDelegator
- Parameters:
entityName
- entity namecondition
- The EntityCondition object that specifies how to constrain this query- Returns:
- count
- See Also:
-
getCountByAnd
Description copied from interface:OfBizDelegator
Runs aCOUNT *
query over the given entity with someWHERE
conditions.In addition to the restrictions given for
OfBizDelegator.getCount(String)
, the view-entity will need to define any columns that you wish to use in the where clause.- Specified by:
getCountByAnd
in interfaceOfBizDelegator
- Parameters:
entityName
- entity namefields
- The fields of the named entity to query by with their corresponding values- Returns:
- count
- See Also:
-
findListIteratorByCondition
public OfBizListIterator findListIteratorByCondition(String entityType, org.ofbiz.core.entity.EntityCondition condition) Description copied from interface:OfBizDelegator
Returns a new OfBizListIterator.IMPORTANT: the returned iterator needs to be properly closed in a
finally
block to avoid connection leaks.- Specified by:
findListIteratorByCondition
in interfaceOfBizDelegator
-
findListIteratorByCondition
public OfBizListIterator findListIteratorByCondition(String entityName, org.ofbiz.core.entity.EntityCondition whereEntityCondition, org.ofbiz.core.entity.EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, org.ofbiz.core.entity.EntityFindOptions entityFindOptions) Description copied from interface:OfBizDelegator
Returns a new OfBizListIterator.IMPORTANT: the returned iterator needs to be properly closed in a
finally
block to avoid connection leaks.- Specified by:
findListIteratorByCondition
in interfaceOfBizDelegator
-
bulkUpdateByPrimaryKey
Description copied from interface:OfBizDelegator
This can be used to perform an update on the entityName of all the rows identified by the keys with the values stored in the updateValues.- Specified by:
bulkUpdateByPrimaryKey
in interfaceOfBizDelegator
- Parameters:
entityName
- identifies the table to perform the update on.updateValues
- is a map where the key is the fieldName and the value is the value to update the column to.keys
- is a list of Long values that represent the primary keys of the the where clause.- Returns:
- the number of rows updated
-
bulkUpdateByAnd
Description copied from interface:OfBizDelegator
This can be used to perform an update on the entityName of all the rows identified by AND criteria of the fields specified by the criteria map.- Specified by:
bulkUpdateByAnd
in interfaceOfBizDelegator
- Parameters:
entityName
- identifies the table to perform the update on.updateValues
- is a map where the key is the fieldName and the value is the value to update the column to.criteria
- map of field to value mapping that will be used to generate the where clause of the update SQL statement. Multiple entries in the map are joined using the AND operator.- Returns:
- the number of rows updated
-
verifyAll
Look through all the fields that are expected, and checks that they have the correct values.- Throws:
AssertionError
- if does not match
-
verifyAll
public void verifyAll(org.ofbiz.core.entity.GenericValue... expectedGenericValues) -
verifyAll
public void verifyAll(List<org.ofbiz.core.entity.GenericValue> expectedGenericValues) throws AssertionError Look through all the fields that are expected, and checks that they have the correct values.- Throws:
AssertionError
- if does not match
-
verify
Look through all the fields that are expected, and checks that they have the correct values. Ignores values that are not in the expected GenericValue.- Throws:
AssertionError
- if does not match
-
verify
public void verify(org.ofbiz.core.entity.GenericValue... expectedGenericValues) -
verify
Look through all the fields that are expected, and checks that they have the correct values. Ignores values that are not in the expected GenericValue.- Parameters:
expectedGenericValues
- overrides anything set during construction- Throws:
AssertionError
- if does not match
-
addRelatedMap
-
addRelatedMap
public void addRelatedMap(String relationName, org.ofbiz.core.entity.GenericValue gv, org.ofbiz.core.entity.GenericValue... gvsToReturns) -
removeByOr
Description copied from interface:OfBizDelegator
This can be used to remove rows for a given entity based onentityName
and whereentityId</q
- Specified by:
removeByOr
in interfaceOfBizDelegator
- Parameters:
entityName
- identifies the table to perform the remove on.entityId
- the Ofbiz fieldName to be used for the identifier, eg WHERE fieldName IN (...). Must be the same case as that found in entitymodel.xml.ids
- a list of entity IDs of the rows to be removed- Returns:
- number of rows removed
-
findByCondition
public List<org.ofbiz.core.entity.GenericValue> findByCondition(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws DataAccessException Description copied from interface:OfBizDelegator
Finds GenericValues by the conditions specified in the EntityCondition object.- Specified by:
findByCondition
in interfaceOfBizDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity model XML fileentityCondition
- The EntityCondition object that specifies how to constrain this queryfieldsToSelect
- 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 descending- Returns:
- List of GenericValue objects representing the search results
- Throws:
DataAccessException
- If an error occurs in the persistence layer.
-
findByCondition
public List<org.ofbiz.core.entity.GenericValue> findByCondition(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, Collection<String> fieldsToSelect) Description copied from interface:OfBizDelegator
Finds GenericValues by the conditions specified in the EntityCondition object with no specified order.Convenience method for calling
OfBizDelegator.findByCondition(String, EntityCondition, Collection, List)
with an empty orderBy list.- Specified by:
findByCondition
in interfaceOfBizDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity model XML fileentityCondition
- The EntityCondition object that specifies how to constrain this queryfieldsToSelect
- The fields of the named entity to get from the database; if empty or null all fields will be retreived- Returns:
- List of GenericValue objects representing the search results
-
getModelReader
public org.ofbiz.core.entity.model.ModelReader getModelReader()Description copied from interface:OfBizDelegator
Returns a model reader that can be used to retrieve all the different entitynames configured in the entitymodel.- Specified by:
getModelReader
in interfaceOfBizDelegator
- Returns:
- a
ModelReader
-
setModelReader
public void setModelReader(org.ofbiz.core.entity.model.ModelReader modelReader) -
refreshSequencer
public void refreshSequencer()Description copied from interface:OfBizDelegator
Refreshes the sequencer that is used to retrieve unique IDs in the database.- Specified by:
refreshSequencer
in interfaceOfBizDelegator
-
getDelegatorInterface
public org.ofbiz.core.entity.DelegatorInterface getDelegatorInterface()Description copied from interface:OfBizDelegator
Returns the underlying raw Entity Engine DelegatorInterface.- Specified by:
getDelegatorInterface
in interfaceOfBizDelegator
- Returns:
- the underlying raw Entity Engine DelegatorInterface.
-
removeRelated
Description copied from interface:OfBizDelegator
Remove all the entities related to the passed generic value via the passed relationship name.- Specified by:
removeRelated
in interfaceOfBizDelegator
- Parameters:
relationName
- the name of the relationship.schemeGv
- the gv at the start of the relationship.- Returns:
- true the database was changed, false otherwise.
-
bulkCopyColumnValuesByAnd
Description copied from interface:OfBizDelegator
This can be used to perform an update on the entityName of all the rows identified by AND criteria of the fields specified by the criteria map.- Specified by:
bulkCopyColumnValuesByAnd
in interfaceOfBizDelegator
- Parameters:
entityName
- table na,eupdateColumns
- map of update to - update from columnscriteria
- map of column names and their values that will create WHERE clause- Returns:
- the number of rows updated
-
transform
public List<org.ofbiz.core.entity.GenericValue> transform(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, List<String> orderBy, String lockField, org.ofbiz.core.entity.Transformation transformation) Description copied from interface:OfBizDelegator
Applies the given transformation to any entities matching the given condition.- Specified by:
transform
in interfaceOfBizDelegator
- Parameters:
entityName
- the type of entity to transform (required)entityCondition
- the condition that selects the entities to transform (null means transform all)orderBy
- the order in which the entities should be selected for updating (null means no ordering)lockField
- the entity field to use for optimistic locking; the value of this field will be read between the SELECT and the UPDATE to determine whether another process has updated one of the target records in the meantime; if so, the transformation will be reapplied and another UPDATE attemptedtransformation
- the transformation to apply (required)- Returns:
- the transformed entities in the order they were selected (never null)
-
transformOne
public org.ofbiz.core.entity.GenericValue transformOne(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, String lockField, org.ofbiz.core.entity.Transformation transformation) Description copied from interface:OfBizDelegator
Applies the given transformation to the entity matching the given condition.- Specified by:
transformOne
in interfaceOfBizDelegator
- Parameters:
entityName
- the type of entity to transform (required)entityCondition
- the condition that selects the entity to transform (must select one entity)lockField
- the entity field to use for optimistic locking; the value of this field will be read between the SELECT and the UPDATE to determine whether another process has updated one of the target records in the meantime; if so, the transformation will be reapplied and another UPDATE attemptedtransformation
- the transformation to apply (required)- Returns:
- the transformed entity (never null)
-
toString
-
clear
public void clear()Removes all values from the "database".
-