com.atlassian.jira.issue.fields.config.persistence
Class FieldConfigSchemePersisterImpl

java.lang.Object
  extended by com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl
All Implemented Interfaces:
FieldConfigSchemePersister
Direct Known Subclasses:
CachedFieldConfigSchemePersister

public class FieldConfigSchemePersisterImpl
extends Object
implements FieldConfigSchemePersister


Field Summary
static String ENTITY_CONFIG_ID
           
static String ENTITY_DESCRIPTION
           
static String ENTITY_FIELD
           
static String ENTITY_ID
           
static String ENTITY_ISSUE_TYPE
           
static String ENTITY_NAME
           
static String ENTITY_RELATED_TABLE_NAME
           
static String ENTITY_SCHEME_ID
           
static String ENTITY_TABLE_NAME
           
static String FK_RELATED_CONFIGS
           
 
Constructor Summary
FieldConfigSchemePersisterImpl(OfBizDelegator delegator, ConstantsManager constantsManager, FieldConfigPersister fieldConfigPersister)
           
 
Method Summary
 FieldConfigScheme create(FieldConfigScheme configScheme, ConfigurableField field)
           
 FieldConfigScheme createWithDefaultValues(ConfigurableField field, Map configs)
           
 List getConfigSchemesForCustomField(ConfigurableField field)
           
 FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
           
 Collection 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(FieldConfigScheme configScheme)
           
 void removeByIssueType(IssueType issueType)
          Removes FieldConfigScheme associations for the given issue type.
 FieldConfigScheme update(FieldConfigScheme configScheme)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITY_TABLE_NAME

public static final String ENTITY_TABLE_NAME
See Also:
Constant Field Values

ENTITY_ID

public static final String ENTITY_ID
See Also:
Constant Field Values

ENTITY_NAME

public static final String ENTITY_NAME
See Also:
Constant Field Values

ENTITY_DESCRIPTION

public static final String ENTITY_DESCRIPTION
See Also:
Constant Field Values

ENTITY_FIELD

public static final String ENTITY_FIELD
See Also:
Constant Field Values

ENTITY_RELATED_TABLE_NAME

public static final String ENTITY_RELATED_TABLE_NAME
See Also:
Constant Field Values

ENTITY_ISSUE_TYPE

public static final String ENTITY_ISSUE_TYPE
See Also:
Constant Field Values

ENTITY_SCHEME_ID

public static final String ENTITY_SCHEME_ID
See Also:
Constant Field Values

ENTITY_CONFIG_ID

public static final String ENTITY_CONFIG_ID
See Also:
Constant Field Values

FK_RELATED_CONFIGS

public static final String FK_RELATED_CONFIGS
See Also:
Constant Field Values
Constructor Detail

FieldConfigSchemePersisterImpl

public FieldConfigSchemePersisterImpl(OfBizDelegator delegator,
                                      ConstantsManager constantsManager,
                                      FieldConfigPersister fieldConfigPersister)
Method Detail

create

public FieldConfigScheme create(FieldConfigScheme configScheme,
                                ConfigurableField field)
Specified by:
create in interface FieldConfigSchemePersister

createWithDefaultValues

public FieldConfigScheme createWithDefaultValues(ConfigurableField field,
                                                 Map configs)
Specified by:
createWithDefaultValues in interface FieldConfigSchemePersister

getInvalidFieldConfigSchemeAfterIssueTypeRemoval

public Collection getInvalidFieldConfigSchemeAfterIssueTypeRemoval(IssueType issueType)
Description copied from interface: FieldConfigSchemePersister
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.

Specified by:
getInvalidFieldConfigSchemeAfterIssueTypeRemoval in interface FieldConfigSchemePersister
Parameters:
issueType - to be removed
Returns:
A collection of FieldConfigSchemes or an empty collection.

removeByIssueType

public void removeByIssueType(IssueType issueType)
Description copied from interface: FieldConfigSchemePersister
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 FieldConfigSchemePersister.getInvalidFieldConfigSchemeAfterIssueTypeRemoval(com.atlassian.jira.issue.issuetype.IssueType). Also see FieldConfigSchemeManagerImpl.removeInvalidFieldConfigSchemesForIssueType(com.atlassian.jira.issue.issuetype.IssueType) for correct usage.

Specified by:
removeByIssueType in interface FieldConfigSchemePersister
Parameters:
issueType - the issue type to remove the assocations for

init

public void init()
Specified by:
init in interface FieldConfigSchemePersister

update

public FieldConfigScheme update(FieldConfigScheme configScheme)
Specified by:
update in interface FieldConfigSchemePersister

remove

public void remove(FieldConfigScheme configScheme)
Specified by:
remove in interface FieldConfigSchemePersister

getFieldConfigScheme

public FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
Specified by:
getFieldConfigScheme in interface FieldConfigSchemePersister

getConfigSchemesForCustomField

public List getConfigSchemesForCustomField(ConfigurableField field)
Specified by:
getConfigSchemesForCustomField in interface FieldConfigSchemePersister


Copyright © 2002-2008 Atlassian. All Rights Reserved.