We have seen how various entities in the JIRA database are defined and how we can introduce new entities. In this recipe, we will see how we can read and write data from the database using these entity definitions.
JIRA exposes the OfBizDelegator
(https://docs.atlassian.com/jira/latest/com/atlassian/jira/ofbiz/OfBizDelegator.html) component, which is a wrapper around org.ofbiz.core.entity.DelegatorInterface
, to communicate with its database using the Ofbiz layer.
You can get hold of an instance of OfBizDelegator
by injecting it in the constructor or from ComponentAccessor
, as follows:
OfBizDelegator delegator = ComponentAccessor.getOfBizDelegator();