Class FieldConfigSchemePersisterImpl
java.lang.Object
com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl
- All Implemented Interfaces:
InitializingComponent,FieldConfigSchemePersister
- Direct Known Subclasses:
CachedFieldConfigSchemePersister
public class FieldConfigSchemePersisterImpl
extends Object
implements FieldConfigSchemePersister, InitializingComponent
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFieldConfigSchemePersisterImpl(OfBizDelegator ofBizDelegator, QueryDslAccessor queryDslAccessor, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister, FieldConfigContextPersister contextPersister, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.create(FieldConfigScheme configScheme, ConfigurableField field) createWithDefaultValues(ConfigurableField field, Map<String, FieldConfig> configs) filterRelevantFields(IssueContext issueContext, Set<String> candidateFields) Given a set of candidate fields, returns only those applicable to a given project and issue type.getConfigSchemeForFieldConfig(FieldConfig fieldConfig) Finds theFieldConfigSchemethat contains theFieldConfiggetConfigSchemeIdsForCustomFieldId(String customFieldId) Retrieves the ids of the field config schemes for the specified customfield id.getFieldConfigScheme(Long configSchemeId) Returns a collection of theFieldConfigSchemes that will be made invalid if the issueType is removed (that is the FieldConfigScheme would no longer be bound to ANY issue types).getRelevantFields(Long projectId, String issueTypeId) Returns a set of field id that are applicable to a given project and issue type.voidinit()protected voidvoidvoidremoveByIssueType(IssueType issueType) RemovesFieldConfigSchemeassociations for the given issue type.protected FieldConfigSchemeremoveIfExist(Long fieldConfigSchemeId) Remove a field config from the database, returning the removed object if it exists.protected voidremoveRelatedConfigsForUpdate(FieldConfigScheme configScheme, org.ofbiz.core.entity.GenericValue gv) update(FieldConfigScheme configScheme)
-
Field Details
-
ENTITY_TABLE_NAME
- See Also:
-
ENTITY_ID
- See Also:
-
ENTITY_NAME
- See Also:
-
ENTITY_DESCRIPTION
- See Also:
-
ENTITY_FIELD
- See Also:
-
ENTITY_RELATED_TABLE_NAME
- See Also:
-
ENTITY_ISSUE_TYPE
- See Also:
-
ENTITY_SCHEME_ID
- See Also:
-
ENTITY_CONFIG_ID
- See Also:
-
FK_RELATED_CONFIGS
- See Also:
-
-
Constructor Details
-
FieldConfigSchemePersisterImpl
public FieldConfigSchemePersisterImpl(OfBizDelegator ofBizDelegator, QueryDslAccessor queryDslAccessor, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister, FieldConfigContextPersister contextPersister, com.atlassian.cache.CacheManager cacheManager)
-
-
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
-
create
- Specified by:
createin interfaceFieldConfigSchemePersister
-
createWithDefaultValues
public FieldConfigScheme createWithDefaultValues(ConfigurableField field, Map<String, FieldConfig> configs) - Specified by:
createWithDefaultValuesin interfaceFieldConfigSchemePersister
-
getInvalidFieldConfigSchemeAfterIssueTypeRemoval
public Collection<FieldConfigScheme> getInvalidFieldConfigSchemeAfterIssueTypeRemoval(IssueType issueType) Description copied from interface:FieldConfigSchemePersisterReturns a collection of theFieldConfigSchemes that will be made invalid if the issueType is removed (that is the FieldConfigScheme would no longer be bound to ANY issue types). If there are still any other issue types that a FieldConfigScheme will be bound to after the removal then it will not be included in the collection returned.- Specified by:
getInvalidFieldConfigSchemeAfterIssueTypeRemovalin interfaceFieldConfigSchemePersister- Parameters:
issueType- to be removed- Returns:
- A collection of
FieldConfigSchemes or an empty collection.
-
removeByIssueType
Description copied from interface:FieldConfigSchemePersisterRemovesFieldConfigSchemeassociations for the given issue type. Please note that this method call on it's own is NOT safe. it removes rows from a many-to-many table without considering other entities in the many-to-many relationship. What this means is that if there's only one row left in the table, this method may remove it, and you'll end up with orphaned values. Only use this in conjunction withFieldConfigSchemePersister.getInvalidFieldConfigSchemeAfterIssueTypeRemoval(com.atlassian.jira.issue.issuetype.IssueType).Also see
FieldConfigSchemeManagerImpl.removeInvalidFieldConfigSchemesForIssueType(com.atlassian.jira.issue.issuetype.IssueType)for correct usage.- Specified by:
removeByIssueTypein interfaceFieldConfigSchemePersister- Parameters:
issueType- the issue type to remove the associations for
-
init
public void init()- Specified by:
initin interfaceFieldConfigSchemePersister
-
update
- Specified by:
updatein interfaceFieldConfigSchemePersister
-
removeRelatedConfigsForUpdate
protected void removeRelatedConfigsForUpdate(@Nonnull FieldConfigScheme configScheme, @Nonnull org.ofbiz.core.entity.GenericValue gv) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
remove
- Specified by:
removein interfaceFieldConfigSchemePersister
-
removeIfExist
Remove a field config from the database, returning the removed object if it exists.- Parameters:
fieldConfigSchemeId- Id of the config to be removed- Returns:
- the removed configuration scheme.
-
getFieldConfigScheme
- Specified by:
getFieldConfigSchemein interfaceFieldConfigSchemePersister
-
getConfigSchemesForCustomField
- Specified by:
getConfigSchemesForCustomFieldin interfaceFieldConfigSchemePersister
-
getConfigSchemeForFieldConfig
Description copied from interface:FieldConfigSchemePersisterFinds theFieldConfigSchemethat contains theFieldConfig- Specified by:
getConfigSchemeForFieldConfigin interfaceFieldConfigSchemePersister- Parameters:
fieldConfig- the config to find the containingFieldConfigSchemeof; cannot be null.- Returns:
- the first scheme that contains the
FieldConfig. Not Null.
-
getConfigSchemeIdsForCustomFieldId
Description copied from interface:FieldConfigSchemePersisterRetrieves the ids of the field config schemes for the specified customfield id. This method should be used when fullFieldConfigSchemedomain objects are not required, for example when removing them from the system.- Specified by:
getConfigSchemeIdsForCustomFieldIdin interfaceFieldConfigSchemePersister- Parameters:
customFieldId- the id of the customfield- Returns:
- a list of ids of the
FieldConfigSchemeobjects associated with this customfield. Should not be null.
-
getRelevantFields
Description copied from interface:FieldConfigSchemePersisterReturns a set of field id that are applicable to a given project and issue type.- Specified by:
getRelevantFieldsin interfaceFieldConfigSchemePersister
-
filterRelevantFields
@Nonnull public Set<String> filterRelevantFields(IssueContext issueContext, Set<String> candidateFields) Description copied from interface:FieldConfigSchemePersisterGiven a set of candidate fields, returns only those applicable to a given project and issue type.- Specified by:
filterRelevantFieldsin interfaceFieldConfigSchemePersister
-
invalidateAll
protected void invalidateAll()
-