Class ArtifactDefinitionHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<ArtifactDefinition>
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
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionArtifactDefinitionHibernateDao(@NotNull BambooClusterSettings bambooClusterSettings) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(@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 ArtifactDefinitionfindById(long id) Get artifact definition of specified id@Nullable ArtifactDefinitionfindByName(@NotNull ImmutablePlan plan, @NotNull String name) Find artifact definition of a given name associated with a producer job.@Nullable ArtifactDefinitionfindByNameInChain(@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 BambooEntityOidgetMaxArtifactDefinitionOid(int serverKey) Find maximum oid used by existing objects in the db.protected @NotNull Optional<VersioningSupplement<Plan>> voidremoveByProducer(@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, incrementRootVersion, save, saveAllMethods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, executeCountQuery, findAll, findAll, findById, mergeMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, findAll, findAll, findById, merge, save, saveAll
-
Constructor Details
-
ArtifactDefinitionHibernateDao
@Inject public ArtifactDefinitionHibernateDao(@NotNull @NotNull BambooClusterSettings bambooClusterSettings)
-
-
Method Details
-
getRootVersioningSupplement
- Overrides:
getRootVersioningSupplementin classBambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan>
-
findById
Description copied from interface:ArtifactDefinitionDaoGet artifact definition of specified id- Specified by:
findByIdin 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:ArtifactDefinitionDaoFind artifact definition of a given name associated with a producer job.- Specified by:
findByNamein 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:ArtifactDefinitionDaoFind 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:
findByNameInChainin 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
-
findAll
Description copied from interface:ArtifactDefinitionDaoFind all artifact definitions- Specified by:
findAllin interfaceArtifactDefinitionDao- Returns:
- Collection of all artifact definitions
-
findAll
@NotNull public @NotNull Collection<? extends ArtifactDefinition> findAll(int firstResult, int maxResults) - Specified by:
findAllin interfaceArtifactDefinitionDao
-
findByProducer
@NotNull public @NotNull List<ArtifactDefinition> findByProducer(@NotNull @NotNull ImmutablePlan plan) Description copied from interface:ArtifactDefinitionDaoGet list of artifact definitions associated with a plan- Specified by:
findByProducerin interfaceArtifactDefinitionDao- Parameters:
plan- plan which associated artifact definitions should be retrieved- Returns:
- list of artifact definitions
-
delete
Description copied from interface:BambooObjectDaoRemoves the given entity from the database- Specified by:
deletein interfaceBambooObjectDao<ArtifactDefinition>- Overrides:
deletein 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:BambooObjectDaoRemove all elements in the collection from database- Specified by:
deleteAllin interfaceBambooObjectDao<ArtifactDefinition>- Overrides:
deleteAllin classBambooHibernateVersionAwareObjectDao<ArtifactDefinition,Plan> - Parameters:
artifactDefinitions- elements to be removed from database
-
removeByProducer
Description copied from interface:ArtifactDefinitionDaoRemove all artifact definitions associated with a plan.- Specified by:
removeByProducerin interfaceArtifactDefinitionDao- Parameters:
plan- plan which associated artifact definitions should be removed
-
getMaxArtifactDefinitionOid
Description copied from interface:ArtifactDefinitionDaoFind maximum oid used by existing objects in the db.- Specified by:
getMaxArtifactDefinitionOidin interfaceArtifactDefinitionDao- Parameters:
serverKey-- Returns:
-