Class EagerLoadingOfBizCustomFieldPersister
java.lang.Object
com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister
com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister
- All Implemented Interfaces:
IdentifiableComponent,InitializingComponent,CustomFieldValuePersister
public class EagerLoadingOfBizCustomFieldPersister
extends OfBizCustomFieldValuePersister
implements InitializingComponent
Many times, the values for custom fields are all retrieved at the same time - such as viewing all values for an
issue, or indexing all custom fields.
It therefore makes sense to eagerly loaded, reducing the number of database calls needed.
-
Field Summary
Fields inherited from class com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister
DEFAULT_VALUE_ISSUE_ID, DEFAULT_VALUE_TYPE, delegator, ENTITY_CUSTOMFIELD_ID, ENTITY_ISSUE_ID, ENTITY_PARENT_KEY, ENTITY_VALUE_TYPE, FIELD_TYPE_DATE, FIELD_TYPE_NUMBER, FIELD_TYPE_STRING, FIELD_TYPE_TEXT, TABLE_CUSTOMFIELD_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionEagerLoadingOfBizCustomFieldPersister(OfBizDelegator delegator, Clock clock, JiraProperties properties, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.voidvoidvoidcreateValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values) voidcreateValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values, String parentKey) static IntegergetCacheSize(JiraProperties properties) Return custom field values of given issues batch.protected List<org.ofbiz.core.entity.GenericValue> getValuesForType(CustomField field, Long issueId) protected List<org.ofbiz.core.entity.GenericValue> getValuesForTypeAndParent(CustomField field, Long issueId, String parentKey) removeAllValues(String customFieldId) Called when removing a field.removeValue(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Object value) Removes a specific custom field value for the given custom field, from a given issue, of a particular type.voidupdateValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values) voidupdateValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values, String parentKey) Methods inherited from class com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister
getIssueIdsWithValue, getValues, getValues, removeDuplicateValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister
getValuesMethods inherited from interface com.atlassian.jira.component.IdentifiableComponent
getIdentity
-
Constructor Details
-
EagerLoadingOfBizCustomFieldPersister
public EagerLoadingOfBizCustomFieldPersister(OfBizDelegator delegator, Clock clock, JiraProperties properties, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
createValues
public void createValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values) - Specified by:
createValuesin interfaceCustomFieldValuePersister- Overrides:
createValuesin classOfBizCustomFieldValuePersister
-
createValues
public void createValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values, String parentKey) - Specified by:
createValuesin interfaceCustomFieldValuePersister- Overrides:
createValuesin classOfBizCustomFieldValuePersister
-
updateValues
public void updateValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values) - Specified by:
updateValuesin interfaceCustomFieldValuePersister- Overrides:
updateValuesin classOfBizCustomFieldValuePersister
-
updateValues
public void updateValues(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Collection values, String parentKey) - Specified by:
updateValuesin interfaceCustomFieldValuePersister- Overrides:
updateValuesin classOfBizCustomFieldValuePersister
-
removeValue
public Set<Long> removeValue(CustomField field, Long issueId, PersistenceFieldType persistenceFieldType, Object value) Description copied from interface:CustomFieldValuePersisterRemoves a specific custom field value for the given custom field, from a given issue, of a particular type.- Specified by:
removeValuein interfaceCustomFieldValuePersister- Overrides:
removeValuein classOfBizCustomFieldValuePersister- Parameters:
field- the custom field.issueId- the issue.persistenceFieldType- the data type of the valuevalue- the value to delete.- Returns:
- returns the set of ids of issues that were affected for some reason (should be 1, just the given issue!).
-
removeAllValues
Description copied from interface:CustomFieldValuePersisterCalled when removing a field. Removes all the customfield values linked to the customfield Id provided.- Specified by:
removeAllValuesin interfaceCustomFieldValuePersister- Overrides:
removeAllValuesin classOfBizCustomFieldValuePersister- Parameters:
customFieldId- the id of the custom field- Returns:
- issue IDs affected.
-
getValues
Description copied from interface:CustomFieldValuePersisterReturn custom field values of given issues batch.- Specified by:
getValuesin interfaceCustomFieldValuePersister- Overrides:
getValuesin classOfBizCustomFieldValuePersister
-
clearCache
public void clearCache() -
clearCache
-
getValuesForTypeAndParent
protected List<org.ofbiz.core.entity.GenericValue> getValuesForTypeAndParent(CustomField field, Long issueId, String parentKey) - Overrides:
getValuesForTypeAndParentin classOfBizCustomFieldValuePersister
-
getValuesForType
protected List<org.ofbiz.core.entity.GenericValue> getValuesForType(CustomField field, Long issueId) - Overrides:
getValuesForTypein classOfBizCustomFieldValuePersister
-
getCacheSize
-