public class ArtifactHibernateDao extends StatelessSessionHibernateDaoSupport implements ArtifactDao
Constructor and Description |
---|
ArtifactHibernateDao(TransactionAndHibernateTemplate transactionTemplate) |
Modifier and Type | Method and Description |
---|---|
List<MutableArtifact> |
findAll()
Find all
MutableArtifact |
Map<String,Long> |
findArtifactUsedStorageByLinkType()
Find how much space artifacts use by link type, e.g.
|
MutableArtifact |
findById(long id)
Find
MutableArtifact by id. |
List<MutableArtifact> |
findOrphanedArtifacts()
Find all artifacts that are no longer referenced by any result or version.
|
List<MutableArtifact> |
findPlanArtifactsReferencedByVersion(PlanKey planKey)
Find all artifacts that belong to a plan are part of a deployment version.
|
List<MutableArtifact> |
findPlanResultArtifactsReferencedByVersion(PlanResultKey planResultKey)
Find all artifacts that belong to a build result are part of a deployment version.
|
boolean |
isReferencedByVersion(long artifactId) |
void |
removeAll(Collection<MutableArtifact> artifacts)
Remove all artifacts in the collection
|
void |
removeById(long id)
Remove artifact.
|
void |
removeByPlanKey(PlanKey planKey)
Remove all artifacts that belong to a plan and are not part of a deployment version.
|
void |
removeByPlanResultKey(PlanResultKey planResultKey)
Remove all artifacts that belong to a build result and are not part of a deployment version.
|
void |
save(MutableArtifact artifact)
Save artifact.
|
void |
updatePlanKey(PlanKey originalPlanKey,
PlanKey newPlanKey)
Update planKey in Artifact entities when plan key has changed (ie after moving plan)
|
getCacheAwareHibernateTemplate
public ArtifactHibernateDao(TransactionAndHibernateTemplate transactionTemplate)
public void save(MutableArtifact artifact)
ArtifactDao
save
in interface ArtifactDao
public List<MutableArtifact> findAll()
ArtifactDao
MutableArtifact
findAll
in interface ArtifactDao
@Nullable public MutableArtifact findById(long id)
ArtifactDao
MutableArtifact
by id.findById
in interface ArtifactDao
public boolean isReferencedByVersion(long artifactId)
isReferencedByVersion
in interface ArtifactDao
public List<MutableArtifact> findPlanResultArtifactsReferencedByVersion(@NotNull PlanResultKey planResultKey)
ArtifactDao
findPlanResultArtifactsReferencedByVersion
in interface ArtifactDao
public List<MutableArtifact> findPlanArtifactsReferencedByVersion(@NotNull PlanKey planKey)
ArtifactDao
findPlanArtifactsReferencedByVersion
in interface ArtifactDao
public void removeById(long id)
ArtifactDao
removeById
in interface ArtifactDao
public void removeByPlanKey(@NotNull PlanKey planKey)
ArtifactDao
removeByPlanKey
in interface ArtifactDao
public void removeByPlanResultKey(@NotNull PlanResultKey planResultKey)
ArtifactDao
removeByPlanResultKey
in interface ArtifactDao
public List<MutableArtifact> findOrphanedArtifacts()
ArtifactDao
findOrphanedArtifacts
in interface ArtifactDao
public void removeAll(@NotNull Collection<MutableArtifact> artifacts)
ArtifactDao
removeAll
in interface ArtifactDao
public void updatePlanKey(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey)
ArtifactDao
updatePlanKey
in interface ArtifactDao
originalPlanKey
- original PlanKeynewPlanKey
- new PlanKey@NotNull public Map<String,Long> findArtifactUsedStorageByLinkType()
ArtifactDao
findArtifactUsedStorageByLinkType
in interface ArtifactDao
Copyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.