Class OfBizProjectComponentStore
java.lang.Object
com.atlassian.jira.bc.project.component.OfBizProjectComponentStore
- All Implemented Interfaces:
ProjectComponentStore
Ofbiz non-caching implementation of
ProjectComponentStore. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOfBizProjectComponentStore(OfBizDelegator delegator, DbConnectionManager dbConnectionManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsName(String name, Long projectId) Check whether component with specified name is stored.voidRemove the given component from the persistent storage.voiddeleteAllComponents(Long projectId) Deletes all components in given project.Retrieve the MutableProjectComponent with the specified ID.findAll()Retrieve all ProjectComponent objects stored and sort by name.findAllForProject(Long projectId) Retrieve all components that are related to the project with given ID and sort by name.findByComponentName(Long projectId, String componentName) Finds the ProjectComponent with the given name (case sensitive) in the project with the given Id.findByComponentNameCaseInSensitive(String componentName) Finds the ProjectComponents with the given name (case insensitive) in all projects.findComponentsBylead(String userKey) Retrieve a collection of components - where the lead of each component is the specified user.findProjectIdForComponent(Long componentId) Retrieve the project ID for the given component ID.protected ComponentConvertergetProjectComponent(Long projectComponentId) Returns the ProjectComponent for the given ID, or null.store(MutableProjectComponent component) Persists the component.
-
Field Details
-
log
public static final org.apache.log4j.Logger log
-
-
Constructor Details
-
OfBizProjectComponentStore
public OfBizProjectComponentStore(OfBizDelegator delegator, DbConnectionManager dbConnectionManager)
-
-
Method Details
-
find
Retrieve the MutableProjectComponent with the specified ID. An EntityNotFoundException is thrown if the component is not found.- Specified by:
findin interfaceProjectComponentStore- Parameters:
id- component ID to search for- Returns:
- MutableProjectComponent component with the specified ID
- Throws:
EntityNotFoundException- if the component is not found
-
getProjectComponent
Description copied from interface:ProjectComponentStoreReturns the ProjectComponent for the given ID, or null.- Specified by:
getProjectComponentin interfaceProjectComponentStore- Parameters:
projectComponentId- the ID- Returns:
- the ProjectComponent for the given ID, or null.
-
findAllForProject
Retrieve all components that are related to the project with given ID and sort by name.- Specified by:
findAllForProjectin interfaceProjectComponentStore- Parameters:
projectId- project ID- Returns:
- a collection of ProjectComponent objects that are related to the project with given ID
-
getComponentConverter
-
findByComponentName
public MutableProjectComponent findByComponentName(Long projectId, String componentName) throws IllegalArgumentException Description copied from interface:ProjectComponentStoreFinds the ProjectComponent with the given name (case sensitive) in the project with the given Id.- Specified by:
findByComponentNamein interfaceProjectComponentStore- Parameters:
projectId- the id of the component's project.componentName- the name of the component to find.- Returns:
- a MutableProjectComponent or null if none found.
- Throws:
IllegalArgumentException
-
findByComponentNameCaseInSensitive
Description copied from interface:ProjectComponentStoreFinds the ProjectComponents with the given name (case insensitive) in all projects.- Specified by:
findByComponentNameCaseInSensitivein interfaceProjectComponentStore- Parameters:
componentName- the name of the component to find.- Returns:
- All MutableProjectComponents with the given name or an empty list if none found.
-
findProjectIdForComponent
Retrieve the project ID for the given component ID. If project is not found, a EntityNotFoundException is thrown.- Specified by:
findProjectIdForComponentin interfaceProjectComponentStore- Parameters:
componentId- component ID- Returns:
- project ID
- Throws:
EntityNotFoundException- if component not found for the given component ID
-
store
public MutableProjectComponent store(MutableProjectComponent component) throws EntityNotFoundException, DataAccessException Persists the component. If component has no ID (null), it is inserted in the store, otherwise an update operation is performed on the store.- Specified by:
storein interfaceProjectComponentStore- Parameters:
component- component to persist- Returns:
- persisted project component
- Throws:
EntityNotFoundException- in case of update if the component does not exist (maybe was deleted :-)DataAccessException- if cannot persist the component
-
delete
Description copied from interface:ProjectComponentStoreRemove the given component from the persistent storage.- Specified by:
deletein interfaceProjectComponentStore- Parameters:
componentId- ID of the component.- Throws:
EntityNotFoundException- if component does not exist (maybe was removed previously).
-
deleteAllComponents
Description copied from interface:ProjectComponentStoreDeletes all components in given project.- Specified by:
deleteAllComponentsin interfaceProjectComponentStore- Parameters:
projectId- id of the project in which components will be deleted.
-
containsName
Check whether component with specified name is stored.- Specified by:
containsNamein interfaceProjectComponentStore- Parameters:
name- component name, null will cause IllegalArgumentExceptionprojectId- project ID- Returns:
- true if new name is stored
- Throws:
IllegalArgumentException- if name or projectId is null
-
findComponentsBylead
Retrieve a collection of components - where the lead of each component is the specified user.- Specified by:
findComponentsByleadin interfaceProjectComponentStore- Parameters:
userKey- the lead user's key- Returns:
- collection of components - where the lead of each component is the specified user
-
findAll
Retrieve all ProjectComponent objects stored and sort by name.- Specified by:
findAllin interfaceProjectComponentStore- Returns:
- all ProjectComponent objects stored
-