com.atlassian.jira.ofbiz.OfBizDelegator |
![]() |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
A wrapper around org.ofbiz.core.entity.DelegatorInterface that does not throw GenericEntityException.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ISSUE_LINK | ||||||||||
String | ISSUE_LINK_TYPE | ||||||||||
String | PROJECT_COMPONENT | ||||||||||
String | VERSION |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
Creates a new GenericValue, and persists it.
| |||||||||||
Creates a new GenericValue, and persists it without trying to automatically populate the ID column.
| |||||||||||
Finds GenericValue records by all of the specified fields (ie: combined using AND).
| |||||||||||
Finds GenericValues by the conditions specified in the EntityCondition object.
| |||||||||||
Finds GenericValues by the conditions specified in the EntityCondition object with no specified order.
| |||||||||||
Finds GenericValue records by the specified field value.
| |||||||||||
Finds GenericValue records by the specified field value.
| |||||||||||
Find a Generic Entity by its numeric ID.
| |||||||||||
Find a Generic Entity by its single numeric Primary Key.
| |||||||||||
Find a Generic Entity by its Primary Key.
| |||||||||||
Returns a new OfBizListIterator.
| |||||||||||
Returns a new OfBizListIterator.
| |||||||||||
Runs a
COUNT * query over the given entity. | |||||||||||
Runs a
COUNT * query over the given entity with some WHERE conditions. | |||||||||||
Returns the underlying raw Entity Engine DelegatorInterface.
| |||||||||||
Returns a model reader that can be used to retrieve all the different entitynames configured in the
entitymodel.
| |||||||||||
Creates an Entity in the form of a GenericValue without persisting it.
| |||||||||||
Creates an Entity in the form of a GenericValue without persisting it.
| |||||||||||
Refreshes the sequencer that is used to retrieve unique IDs in the database.
| |||||||||||
Remove the given entity from the DB.
| |||||||||||
This can be used to remove rows for a given entity based on entityName
and where entityId
| |||||||||||
Remove all the entities related to the passed generic value via the passed relationship name.
| |||||||||||
Applies the given transformation to any entities matching the given condition.
| |||||||||||
Applies the given transformation to the entity matching the given condition.
|
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.
entityName | table na,e |
---|---|
updateColumns | map of update to - update from columns |
criteria | map of column names and their values that will create WHERE clause |
DataAccessException | If an error occurs in the persistence layer. |
---|
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.
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. |
DataAccessException | If an error occurs in the persistence layer. |
---|
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.
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. |
DataAccessException | If an error occurs in the persistence layer. |
---|
Creates a new GenericValue, and persists it.
If there is no "id" in the field values, one is created using the entity sequence.
entityName | the entity name. |
---|---|
fields | field values |
DataAccessException | if an error occurs in the Database layer |
---|
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.
entityName | the entity name. |
---|---|
fields | field values |
DataAccessException | if an error occurs in the Database layer |
---|
DataAccessException |
---|
DataAccessException |
---|
Finds GenericValue records by all of the specified fields (ie: combined using AND).
entityName | The Name of the Entity as defined in the entity XML file |
---|---|
fields | The fields of the named entity to query by with their corresponding values |
DataAccessException | If an error occurs in the persistence layer. |
---|
Finds GenericValues by the conditions specified in the EntityCondition object.
entityName | The Name of the Entity as defined in the entity model XML file |
---|---|
entityCondition | The EntityCondition object that specifies how to constrain this query |
fieldsToSelect | The fields of the named entity to get from the database; if empty or null all fields will be retreived |
orderBy | The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending |
DataAccessException | If an error occurs in the persistence layer. |
---|
Finds GenericValues by the conditions specified in the EntityCondition object with no specified order.
Convenience method for calling findByCondition(String, EntityCondition, Collection, List)
with
an empty orderBy list.
entityName | The Name of the Entity as defined in the entity model XML file |
---|---|
entityCondition | The EntityCondition object that specifies how to constrain this query |
fieldsToSelect | The fields of the named entity to get from the database; if empty or null all fields will be retreived |
DataAccessException | If an error occurs in the persistence layer. |
---|
Finds GenericValue records by the specified field value.
entityName | The Name of the Entity as defined in the entity XML file |
---|---|
fieldName | The field to do filtering by. |
fieldValue | The desired value for the filtering field. |
DataAccessException | If an error occurs in the persistence layer. |
---|
Finds GenericValue records by the specified field value.
entityName | The Name of the Entity as defined in the entity XML file |
---|---|
fieldName | The field to do filtering by. |
fieldValue | The desired value for the filtering field. |
orderBy | Single field to order by. |
DataAccessException | If an error occurs in the persistence layer. |
---|
Find a Generic Entity by its numeric ID.
This method is a synonym for findByPrimaryKey(String, Long)
entityName | The Name of the Entity as defined in the entity XML file |
---|---|
id | The numeric "id" field value that is the primary key of this entity. |
DataAccessException | DataAccessException |
---|
DataAccessException |
---|
DataAccessException |
---|
DataAccessException |
---|
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.
entityName | The Name of the Entity as defined in the entity XML file |
---|---|
id | The numeric "id" field value that is the primary key of this entity. |
DataAccessException | DataAccessException |
---|
Find a Generic Entity by its Primary Key.
entityName | The Name of the Entity as defined in the entity XML file |
---|---|
fields | The field/value pairs of the primary key (in JIRA, mostly just a single field "id") |
DataAccessException | DataAccessException |
---|
Returns a new OfBizListIterator.
IMPORTANT: the returned iterator needs to be properly closed in a finally
block to avoid connection
leaks.
DataAccessException |
---|
Returns a new OfBizListIterator.
IMPORTANT: the returned iterator needs to be properly closed in a finally
block to avoid connection
leaks.
DataAccessException |
---|
Runs a COUNT *
query over the given entity.
Ensure that there is a view-entity defined in entitymodel.xml
and entitygroup.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
's Select
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 add-on developers, this can only be
done directly through the lower level DelegatorInterface
at this time.
entityName | entity name |
---|
DataAccessException | if data access problems occur |
---|
Runs a COUNT *
query over the given entity with some WHERE
conditions.
In addition to the restrictions given for getCount(String)
, the view-entity will need to define
any columns that you wish to use in the where clause.
entityName | entity name |
---|---|
fields | The fields of the named entity to query by with their corresponding values |
DataAccessException | if data access problems occur |
---|
Returns the underlying raw Entity Engine DelegatorInterface.
Returns a model reader that can be used to retrieve all the different entitynames configured in the entitymodel.
DataAccessException |
---|
DataAccessException |
---|
Creates an Entity in the form of a GenericValue without persisting it.
entityName | the entity name. |
---|
Creates an Entity in the form of a GenericValue without persisting it.
entityName | the entity name. |
---|---|
fields | initial field values |
Refreshes the sequencer that is used to retrieve unique IDs in the database.
DataAccessException |
---|
Remove the given entity from the DB.
entityName | the entity type (ie TABLE) |
---|---|
id | the id of the row to delete. |
This can be used to remove rows for a given entity based on entityName
and where entityId
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 |
GenericModelException | if the given entityId is not valid for the given entity |
---|---|
DataAccessException | if there are problems executing/accessing the data store |
Remove all the entities related to the passed generic value via the passed relationship name.
relationName | the name of the relationship. |
---|---|
schemeGv | the gv at the start of the relationship. |
Applies the given transformation to any entities matching the given condition.
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 attempted |
transformation | the transformation to apply (required) |
Applies the given transformation to the entity matching the given condition.
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 attempted |
transformation | the transformation to apply (required) |
IllegalArgumentException | if the given condition selects more than one entity |
---|