public class

FieldConfigSchemePersisterImpl

extends Object
implements FieldConfigSchemePersister
java.lang.Object
   ↳ com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl
Known Direct Subclasses

Summary

Constants
String ENTITY_CONFIG_ID
String ENTITY_DESCRIPTION
String ENTITY_FIELD
String ENTITY_ID
String ENTITY_ISSUE_TYPE
String ENTITY_NAME
String ENTITY_RELATED_TABLE_NAME
String ENTITY_SCHEME_ID
String ENTITY_TABLE_NAME
String FK_RELATED_CONFIGS
Public Constructors
FieldConfigSchemePersisterImpl(OfBizDelegator ofBizDelegator, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister, FieldConfigContextPersister contextPersister, CacheManager cacheManager)
Public Methods
FieldConfigScheme create(FieldConfigScheme configScheme, ConfigurableField field)
FieldConfigScheme createWithDefaultValues(ConfigurableField field, Map<StringFieldConfig> configs)
FieldConfigScheme getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
Finds the FieldConfigScheme that contains the FieldConfig
List<Long> getConfigSchemeIdsForCustomFieldId(String customFieldId)
Retrieves the ids of the field config schemes for the specified customfield id.
List<FieldConfigScheme> getConfigSchemesForCustomField(ConfigurableField field)
FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
Collection<FieldConfigScheme> getInvalidFieldConfigSchemeAfterIssueTypeRemoval(IssueType issueType)
Returns a collection of the FieldConfigSchemes that will be made invalid if the issueType is removed (that is the FieldConfigScheme would no longer be bound to ANY issue types).
void init()
void remove(Long fieldConfigSchemeId)
void removeByIssueType(IssueType issueType)
Removes FieldConfigScheme associations for the given issue type.
FieldConfigScheme update(FieldConfigScheme configScheme)
Protected Methods
void invalidateAll()
@Nullable FieldConfigScheme removeIfExist(Long fieldConfigSchemeId)
Remove a field config from the database, returning the removed object if it exists.
void removeRelatedConfigsForUpdate(FieldConfigScheme configScheme, GenericValue gv)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersister

Constants

public static final String ENTITY_CONFIG_ID

Constant Value: "fieldconfiguration"

public static final String ENTITY_DESCRIPTION

Constant Value: "description"

public static final String ENTITY_FIELD

Constant Value: "fieldid"

public static final String ENTITY_ID

Constant Value: "id"

public static final String ENTITY_ISSUE_TYPE

Constant Value: "issuetype"

public static final String ENTITY_NAME

Constant Value: "name"

public static final String ENTITY_RELATED_TABLE_NAME

Constant Value: "FieldConfigSchemeIssueType"

public static final String ENTITY_SCHEME_ID

Constant Value: "fieldconfigscheme"

public static final String ENTITY_TABLE_NAME

Constant Value: "FieldConfigScheme"

public static final String FK_RELATED_CONFIGS

Constant Value: "RelatedFieldConfigSchemeIssueType"

Public Constructors

public FieldConfigSchemePersisterImpl (OfBizDelegator ofBizDelegator, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister, FieldConfigContextPersister contextPersister, CacheManager cacheManager)

Public Methods

public FieldConfigScheme create (FieldConfigScheme configScheme, ConfigurableField field)

public FieldConfigScheme createWithDefaultValues (ConfigurableField field, Map<StringFieldConfig> configs)

public FieldConfigScheme getConfigSchemeForFieldConfig (FieldConfig fieldConfig)

Finds the FieldConfigScheme that contains the FieldConfig

Parameters
fieldConfig the config to find the containing FieldConfigScheme of; cannot be null.
Returns
  • the first scheme that contains the FieldConfig. Not Null.

public List<Long> getConfigSchemeIdsForCustomFieldId (String customFieldId)

Retrieves the ids of the field config schemes for the specified customfield id. This method should be used when full FieldConfigScheme domain objects are not required, for example when removing them from the system.

Parameters
customFieldId the id of the customfield
Returns
  • a list of ids of the FieldConfigScheme objects associated with this customfield. Should not be null.

public List<FieldConfigScheme> getConfigSchemesForCustomField (ConfigurableField field)

public FieldConfigScheme getFieldConfigScheme (Long configSchemeId)

public Collection<FieldConfigScheme> getInvalidFieldConfigSchemeAfterIssueTypeRemoval (IssueType issueType)

Returns a collection of the FieldConfigSchemes 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.

Parameters
issueType to be removed
Returns

public void init ()

public void remove (Long fieldConfigSchemeId)

public void removeByIssueType (IssueType issueType)

Removes FieldConfigScheme associations 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 with getInvalidFieldConfigSchemeAfterIssueTypeRemoval(com.atlassian.jira.issue.issuetype.IssueType).

Also see removeInvalidFieldConfigSchemesForIssueType(com.atlassian.jira.issue.issuetype.IssueType) for correct usage.

Parameters
issueType the issue type to remove the associations for

public FieldConfigScheme update (FieldConfigScheme configScheme)

Protected Methods

protected void invalidateAll ()

@Nullable protected FieldConfigScheme removeIfExist (Long fieldConfigSchemeId)

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.

protected void removeRelatedConfigsForUpdate (FieldConfigScheme configScheme, GenericValue gv)

Throws
GenericEntityException