Interface BambooObjectDao<T extends BambooObject>
- Type Parameters:
T
- entity type
- All Known Subinterfaces:
AccessTokenDao
,AgentBuildResultsSummaryDao
,AgentCipherDao
,ArtifactDefinitionDao
,ArtifactSubscriptionDao
,AuditLogDao
,AuthorDao
,BambooObjectWithOidDao<E>
,BambooTrustedApplicationDao
,BranchCommitInformationDao
,BuildResultsSummaryDao
,BuildResultWarningSummaryDao
,CapabilityDao
,ChainStageDao
,CommentDao
,CommitDao
,ConsumedSubscriptionDao
,CredentialsDao
,CrowdDeletedEntityDao
,ElasticTunnelDefinitionDao
,EnvironmentRepositoryLinkDao
,EphemeralAgentTemplateDao
,LinkedJiraIssueDao
,LoginInformationDao
,MergeResultSummaryDao
,PerAgentTokenDao
,PlanDao
,PlanRepositoryLinkDao
,PlanVcsRevisionHistoryStandaloneDao
,ProjectDao
,QuickFilterDao
,QuickFilterRuleDao
,QuickSearchItemDao
,RemoteAgentAuthenticationDao
,RepositoryChangesetDao
,RepositoryDefinitionDao
,ScriptDao
,TestCaseDao
,TestCaseResultDao
,TestResultsDao
,TestsDao
,TrustedKeyDao
,VariableContextBaselineDao
,VariableDefinitionDao
,VcsBranchDao
,VcsPullRequestDao
,VcsTagDao
,WebhookResponseDao
,WebhookTemplateDao
- All Known Implementing Classes:
AgentBuildResultsSummaryHibernateDao
,AgentCipherHibernateDao
,ArtifactDefinitionHibernateDao
,ArtifactSubscriptionHibernateDao
,AuditLogHibernateDao
,AuthorHibernateDao
,BambooHibernateObjectDao
,BambooHibernateObjectWithOidDao
,BambooHibernateVersionAwareObjectDao
,BambooHibernateVersionAwareObjectWithOidDao
,BambooTrustedApplicationsHibernateDao
,BranchCommitInformationHibernateDao
,BuildNumberExportHibernateDao
,BuildResultsSummaryHibernateDao
,BuildResultWarningSummaryDaoImpl
,CapabilityDaoImpl
,ChainStageHibernateDao
,CommentHibernateDao
,CommitHibernateDao
,ConsumedSubscriptionHibernateDao
,CredentialsHibernateDao
,CrowdDeletedEntityHibernateDao
,ElasticTunnelDefinitionDaoImpl
,EnvironmentDaoImpl
,EnvironmentRepositoryLinkHibernateDao
,EphemeralAgentTemplateHibernateDao
,HibernateAccessTokenDao
,LinkedJiraIssueHibernateDao
,LoginInformationHibernateDao
,MergeResultSummaryDaoImpl
,PerAgentTokenHibernateDao
,PlanHibernateDao
,PlanRepositoryLinkHibernateDao
,PlanVcsRevisionHistoryHibernateStandaloneDao
,ProjectHibernateDao
,QuickFilterHibernateDao
,QuickFilterRuleHibernateDao
,QuickSearchItemDaoImpl
,RemoteAgentAuthenticationHibernateDao
,RepositoryChangesetHibernateDao
,RepositoryDefinitionHibernateDao
,ScriptDaoImpl
,TestCaseHibernateDao
,TestCaseResultHibernateDao
,TestResultsHibernateDao
,TestsHibernateDao
,TrustedKeyHibernateDaoImpl
,VariableContextBaselineHibernateDao
,VariableDefinitionHibernateDao
,VcsBranchHibernateDao
,VcsPullRequestHibernateDao
,VcsTagDaoImpl
,WebhookResponseHibernateDao
,WebhookTemplateHibernateDao
public interface BambooObjectDao<T extends BambooObject>
Generic Dao for
BambooObject
s-
Method Summary
Modifier and TypeMethodDescription<E extends T>
longFinds the count of all entities that implement the given Class<E extends T>
longcountWithRestriction
(@NotNull Class<E> aClass, org.hibernate.criterion.Criterion restriction) Finds the count of all entities that implement the given class and satisfy the provided restrictionvoid
Removes the given entity from the database<E extends T>
voiddeleteAll
(@NotNull Collection<E> entities) Remove all elements in the collection from database<E extends T>
@NotNull Collection<E>Finds all the entities that implement the givenClass
<E extends T>
EFind an entity by its idMerges the state of the given unmanaged entity.void
Saves the given entity.<E extends T>
voidsaveAll
(@NotNull Collection<E> entities) Save all entities in the collection to the database
-
Method Details
-
save
Saves the given entity. If the entity implementation is an instance ofEntityObject
this method will: - updateEntityObject.getLastModificationDate()
- setEntityObject.getCreationDate()
if the object has not been saved- Parameters:
t
- entity to be saved
-
saveAll
Save all entities in the collection to the database- Parameters:
entities
- entities to be saved to database
-
merge
Merges the state of the given unmanaged entity.This method should only be used with entities which are not currently managed by Hibernate, otherwise
save(BambooObject)
should be called.If the entity implementation is an interface of
EntityObject
, theEntityObject.getCreationDate()
andEntityObject.getLastModificationDate()
properties will be updated accordingly (the former only if a new database object is created).- Parameters:
unmanagedEntity
- entity not managed by Hibernate to mergeentityClass
- class of the entity- Returns:
- managed entity as a result of merging and persisting the data - may be either a newly created or updated database object
-
delete
Removes the given entity from the database- Parameters:
t
- entity to be removed
-
deleteAll
Remove all elements in the collection from database- Parameters:
entities
- elements to be removed from database
-
findAll
Finds all the entities that implement the givenClass
- Parameters:
aClass
- class of entity- Returns:
- entities
-
countAll
Finds the count of all entities that implement the given Class -
countWithRestriction
<E extends T> long countWithRestriction(@NotNull @NotNull Class<E> aClass, org.hibernate.criterion.Criterion restriction) Finds the count of all entities that implement the given class and satisfy the provided restriction -
findById
Find an entity by its id- Parameters:
id
- id of entityaClass
- class of entity- Returns:
- entity
-