com.atlassian.bamboo.plan.artifact
Class ArtifactDefinitionHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<ArtifactDefinition>
              extended by com.atlassian.bamboo.plan.artifact.ArtifactDefinitionHibernateDao
All Implemented Interfaces:
BambooObjectDao<ArtifactDefinition>, ArtifactDefinitionDao, org.springframework.beans.factory.InitializingBean

public class ArtifactDefinitionHibernateDao
extends BambooHibernateObjectDao<ArtifactDefinition>
implements ArtifactDefinitionDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
ArtifactDefinitionHibernateDao()
           
 
Method Summary
 java.util.Collection<? extends ArtifactDefinition> findAll()
          Find all artifact definitions
 ArtifactDefinition findById(long id)
          Get artifact definition of specified id
 ArtifactDefinition findByName(Plan plan, java.lang.String name)
          Find artifact definition of a given name associated with a producer job.
 ArtifactDefinition findByNameInChain(Chain chain, java.lang.String name)
          Find artifact definition of a given name which has sharedArtifact property set to true, associated with a producer job that belongs to the chain.
 java.util.List<ArtifactDefinition> findByProducer(Plan plan)
          Get list of artifact definitions associated with a plan
 void removeByProducer(Plan plan)
          Remove all artifact definitions associated with a plan.
 
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
delete, deleteAll, executeReturnLong, findAll, findById, save, saveAll
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
delete, deleteAll, executeReturnLong, findAll, findById, save, saveAll
 

Constructor Detail

ArtifactDefinitionHibernateDao

public ArtifactDefinitionHibernateDao()
Method Detail

findById

@Nullable
public ArtifactDefinition findById(long id)
Description copied from interface: ArtifactDefinitionDao
Get artifact definition of specified id

Specified by:
findById in interface ArtifactDefinitionDao
Parameters:
id - id of artifact definition
Returns:
artifact definition of specified id or null if not found

findByName

@Nullable
public ArtifactDefinition findByName(@NotNull
                                              Plan plan,
                                              @NotNull
                                              java.lang.String name)
Description copied from interface: ArtifactDefinitionDao
Find artifact definition of a given name associated with a producer job.

Specified by:
findByName in interface ArtifactDefinitionDao
Parameters:
plan - plan which associated artifact definition should be retrieved
name - name to search among plan's artifact definitions
Returns:
artifact definition matching plan and label or null if not found

findByNameInChain

public ArtifactDefinition findByNameInChain(@NotNull
                                            Chain chain,
                                            @NotNull
                                            java.lang.String name)
Description copied from interface: ArtifactDefinitionDao
Find artifact definition of a given name which has sharedArtifact property set to true, associated with a producer job that belongs to the chain.

Specified by:
findByNameInChain in interface ArtifactDefinitionDao
Parameters:
chain - chain which associated artifact definition should be retrieved
name - name to search among plan's artifact definitions
Returns:
artifact definition matching plan and label or null if not found

findAll

@NotNull
public java.util.Collection<? extends ArtifactDefinition> findAll()
Description copied from interface: ArtifactDefinitionDao
Find all artifact definitions

Specified by:
findAll in interface ArtifactDefinitionDao
Returns:
Collection of all artifact definitions

findByProducer

@NotNull
public java.util.List<ArtifactDefinition> findByProducer(@NotNull
                                                                 Plan plan)
Description copied from interface: ArtifactDefinitionDao
Get list of artifact definitions associated with a plan

Specified by:
findByProducer in interface ArtifactDefinitionDao
Parameters:
plan - plan which associated artifact definitions should be retrieved
Returns:
list of artifact definitions

removeByProducer

public void removeByProducer(@NotNull
                             Plan plan)
Description copied from interface: ArtifactDefinitionDao
Remove all artifact definitions associated with a plan.

Specified by:
removeByProducer in interface ArtifactDefinitionDao
Parameters:
plan - plan which associated artifact definitions should be removed


Copyright © 2011 Atlassian. All Rights Reserved.