-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
JIRA Development Cookbook
We have seen how the 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 (http://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 ComponentManager, as follows:
OfBizDelegator delegator = ComponentManager.getInstance().getComponentInstanceOfType(OfBizDelegator.class);
We can read from the database using the various methods exposed via the above delegator class. For example, all the records in the employee table we defined in the previous recipe can be read as:
List<GenericValue> employees ...
Change the font size
Change margin width
Change background colour