Class ArtifactDefinitionHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
-
- com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<T>
-
- com.atlassian.bamboo.persistence3.BambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan>
-
- com.atlassian.bamboo.plan.artifact.ArtifactDefinitionHibernateDao
-
- All Implemented Interfaces:
BambooObjectDao<ArtifactDefinition>
,ArtifactDefinitionDao
,org.springframework.beans.factory.InitializingBean
public class ArtifactDefinitionHibernateDao extends BambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan> implements ArtifactDefinitionDao
-
-
Constructor Summary
Constructors Constructor Description ArtifactDefinitionHibernateDao(@NotNull BambooClusterSettings bambooClusterSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(@NotNull ArtifactDefinition artifactDefinition)
Removes the given entity from the database<E extends ArtifactDefinition>
voiddeleteAll(@NotNull Collection<E> artifactDefinitions)
Remove all elements in the collection from database@NotNull Collection<? extends ArtifactDefinition>
findAll()
Find all artifact definitions@NotNull Collection<? extends ArtifactDefinition>
findAll(int firstResult, int maxResults)
@Nullable ArtifactDefinition
findById(long id)
Get artifact definition of specified id@Nullable ArtifactDefinition
findByName(@NotNull ImmutablePlan plan, @NotNull String name)
Find artifact definition of a given name associated with a producer job.@Nullable ArtifactDefinition
findByNameInChain(@NotNull ImmutableChain chain, @NotNull 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.@NotNull List<ArtifactDefinition>
findByProducer(@NotNull ImmutablePlan plan)
Get list of artifact definitions associated with a plan@NotNull List<ArtifactDefinition>
findSharedArtifactsByChain(@NotNull ImmutableChain chain)
Find all shared artifacts that exist for a particular chain.@NotNull BambooEntityOid
getMaxArtifactDefinitionOid(int serverKey)
Find maximum oid used by existing objects in the db.protected @NotNull Optional<VersioningSupplement<Plan>>
getRootVersioningSupplement()
void
removeByProducer(@NotNull ImmutablePlan plan)
Remove all artifact definitions associated with a plan.-
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateVersionAwareObjectDao
getMainVersioningSupplement, incrementMainVersion, incrementMainVersion, incrementRootVersion, incrementRootVersion, save, saveAll
-
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, executeCountQuery, findAll, findById, merge
-
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
-
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
-
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
countAll, countWithRestriction, findAll, findById, merge, save, saveAll
-
-
-
-
Constructor Detail
-
ArtifactDefinitionHibernateDao
@Inject public ArtifactDefinitionHibernateDao(@NotNull @NotNull BambooClusterSettings bambooClusterSettings)
-
-
Method Detail
-
getRootVersioningSupplement
@NotNull protected @NotNull Optional<VersioningSupplement<Plan>> getRootVersioningSupplement()
- Overrides:
getRootVersioningSupplement
in classBambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan>
-
findById
@Nullable public @Nullable ArtifactDefinition findById(long id)
Description copied from interface:ArtifactDefinitionDao
Get artifact definition of specified id- Specified by:
findById
in interfaceArtifactDefinitionDao
- Parameters:
id
- id of artifact definition- Returns:
- artifact definition of specified id or null if not found
-
findByName
@Nullable public @Nullable ArtifactDefinition findByName(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String name)
Description copied from interface:ArtifactDefinitionDao
Find artifact definition of a given name associated with a producer job.- Specified by:
findByName
in interfaceArtifactDefinitionDao
- Parameters:
plan
- plan which associated artifact definition should be retrievedname
- name to search among plan's artifact definitions- Returns:
- artifact definition matching plan and label or null if not found
-
findByNameInChain
@Nullable public @Nullable ArtifactDefinition findByNameInChain(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull 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 interfaceArtifactDefinitionDao
- Parameters:
chain
- chain which associated artifact definition should be retrievedname
- name to search among plan's artifact definitions- Returns:
- artifact definition matching plan and label or null if not found
-
findSharedArtifactsByChain
@NotNull public @NotNull List<ArtifactDefinition> findSharedArtifactsByChain(@NotNull @NotNull ImmutableChain chain)
Description copied from interface:ArtifactDefinitionDao
Find all shared artifacts that exist for a particular chain.- Specified by:
findSharedArtifactsByChain
in interfaceArtifactDefinitionDao
- Parameters:
chain
- chain which associated artifact definitions should be retrieved- Returns:
- shared artifacts that exist for the specified particular chain
-
findAll
@NotNull public @NotNull Collection<? extends ArtifactDefinition> findAll()
Description copied from interface:ArtifactDefinitionDao
Find all artifact definitions- Specified by:
findAll
in interfaceArtifactDefinitionDao
- Returns:
- Collection of all artifact definitions
-
findAll
@NotNull public @NotNull Collection<? extends ArtifactDefinition> findAll(int firstResult, int maxResults)
- Specified by:
findAll
in interfaceArtifactDefinitionDao
-
findByProducer
@NotNull public @NotNull List<ArtifactDefinition> findByProducer(@NotNull @NotNull ImmutablePlan plan)
Description copied from interface:ArtifactDefinitionDao
Get list of artifact definitions associated with a plan- Specified by:
findByProducer
in interfaceArtifactDefinitionDao
- Parameters:
plan
- plan which associated artifact definitions should be retrieved- Returns:
- list of artifact definitions
-
delete
public void delete(@NotNull @NotNull ArtifactDefinition artifactDefinition)
Description copied from interface:BambooObjectDao
Removes the given entity from the database- Specified by:
delete
in interfaceBambooObjectDao<ArtifactDefinition>
- Overrides:
delete
in classBambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan>
- Parameters:
artifactDefinition
- entity to be removed
-
deleteAll
public <E extends ArtifactDefinition> void deleteAll(@NotNull @NotNull Collection<E> artifactDefinitions)
Description copied from interface:BambooObjectDao
Remove all elements in the collection from database- Specified by:
deleteAll
in interfaceBambooObjectDao<ArtifactDefinition>
- Overrides:
deleteAll
in classBambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan>
- Parameters:
artifactDefinitions
- elements to be removed from database
-
removeByProducer
public void removeByProducer(@NotNull @NotNull ImmutablePlan plan)
Description copied from interface:ArtifactDefinitionDao
Remove all artifact definitions associated with a plan.- Specified by:
removeByProducer
in interfaceArtifactDefinitionDao
- Parameters:
plan
- plan which associated artifact definitions should be removed
-
getMaxArtifactDefinitionOid
@NotNull public @NotNull BambooEntityOid getMaxArtifactDefinitionOid(int serverKey)
Description copied from interface:ArtifactDefinitionDao
Find maximum oid used by existing objects in the db.- Specified by:
getMaxArtifactDefinitionOid
in interfaceArtifactDefinitionDao
- Returns:
-
-