Package com.epam.ta.reportportal.dao
Interface IntegrationRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Integration,java.lang.Long>,FilterableRepository<Integration>,IntegrationRepositoryCustom,org.springframework.data.jpa.repository.JpaRepository<Integration,java.lang.Long>,org.springframework.data.repository.PagingAndSortingRepository<Integration,java.lang.Long>,org.springframework.data.repository.query.QueryByExampleExecutor<Integration>,ReportPortalRepository<Integration,java.lang.Long>,org.springframework.data.repository.Repository<Integration,java.lang.Long>
public interface IntegrationRepository extends ReportPortalRepository<Integration,java.lang.Long>, IntegrationRepositoryCustom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intdeleteAllByProjectIdAndIntegrationTypeId(java.lang.Long projectId, java.lang.Long typeId)Delete allIntegrationby projectID and integration type IDintdeleteAllGlobalByIntegrationTypeId(java.lang.Long typeId)Delete allIntegrationwithIntegration.project== NULL by integration type IDbooleanexistsByNameAndTypeIdAndProjectId(java.lang.String name, java.lang.Long typeId, java.lang.Long projectId)booleanexistsByNameAndTypeIdAndProjectIdIsNull(java.lang.String name, java.lang.Long typeId)java.util.List<Integration>findAllByProjectId(java.lang.Long projectId)Retrieve given project's integrationsjava.util.List<Integration>findAllByProjectIdAndType(java.lang.Long projectId, IntegrationType integrationType)Retrieve allIntegrationby project ID and integration typejava.util.List<Integration>findAllByTypeIn(java.lang.String... types)java.util.List<Integration>findAllGlobal()Retrieve allIntegrationwithIntegration.project== nulljava.util.List<Integration>findAllGlobalByGroup(IntegrationGroupEnum integrationGroup)Retrieve allIntegrationwithIntegration.project== null by integration groupjava.util.List<Integration>findAllGlobalByType(IntegrationType integrationType)Retrieve allIntegrationwithIntegration.project== null by integration typejava.util.List<Integration>findAllProjectByGroup(Project project, IntegrationGroupEnum integrationGroup)Retrieve allIntegrationwithIntegration.projectby integration groupjava.util.Optional<Integration>findAuthByNameAndTypeName(java.lang.String name, java.lang.String typeName)java.util.Optional<Integration>findByIdAndProjectId(java.lang.Long id, java.lang.Long projectId)Retrieve integration by ID and project IDjava.util.Optional<Integration>findByNameAndTypeId(java.lang.String name, java.lang.Long integrationTypeId)java.util.Optional<Integration>findExclusiveAuth(java.lang.String name)java.util.Optional<Integration>findGlobalBtsByUrlAndLinkedProject(java.lang.String url, java.lang.String btsProject)Find BTS integration by BTS url, BTS project name andIntegration.project== nulljava.util.Optional<Integration>findProjectBtsByUrlAndLinkedProject(java.lang.String url, java.lang.String btsProject, java.lang.Long projectId)Find BTS integration by BTS url, BTS project name and Report Portal project idvoidupdateEnabledStateById(boolean enabled, java.lang.Long integrationId)UpdateIntegration.enabledby integration IDvoidupdateEnabledStateByIntegrationTypeId(boolean enabled, java.lang.Long integrationTypeId)UpdateIntegration.enabledof all integrations by integration type id-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
-
Methods inherited from interface com.epam.ta.reportportal.dao.FilterableRepository
findByFilter, findByFilter
-
Methods inherited from interface com.epam.ta.reportportal.dao.IntegrationRepositoryCustom
findAllByProjectIdAndInIntegrationTypeIds, findAllGlobalInIntegrationTypeIds, findAllGlobalNotInIntegrationTypeIds, findGlobalById
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
-
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
-
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findOne
-
Methods inherited from interface com.epam.ta.reportportal.dao.ReportPortalRepository
exists, refresh
-
-
-
-
Method Detail
-
existsByNameAndTypeIdAndProjectIdIsNull
boolean existsByNameAndTypeIdAndProjectIdIsNull(java.lang.String name, java.lang.Long typeId)
-
existsByNameAndTypeIdAndProjectId
boolean existsByNameAndTypeIdAndProjectId(java.lang.String name, java.lang.Long typeId, java.lang.Long projectId)
-
findByIdAndProjectId
java.util.Optional<Integration> findByIdAndProjectId(java.lang.Long id, java.lang.Long projectId)
Retrieve integration by ID and project ID- Parameters:
id- ID of integrationsprojectId- ID of project- Returns:
- Optional of integration
-
findAllByProjectId
java.util.List<Integration> findAllByProjectId(java.lang.Long projectId)
Retrieve given project's integrations- Parameters:
projectId- ID of project- Returns:
- Found integrations
-
findAllByProjectIdAndType
java.util.List<Integration> findAllByProjectIdAndType(java.lang.Long projectId, IntegrationType integrationType)
Retrieve allIntegrationby project ID and integration type- Parameters:
projectId-Project.idintegrationType-IntegrationType- Returns:
- The
Listof theIntegration
-
deleteAllGlobalByIntegrationTypeId
@Modifying @Query(value="DELETE FROM integration WHERE project_id IS NULL AND type = :typeId", nativeQuery=true) int deleteAllGlobalByIntegrationTypeId(@Param("typeId") java.lang.Long typeId)Delete allIntegrationwithIntegration.project== NULL by integration type ID- Parameters:
typeId-IntegrationType.id
-
deleteAllByProjectIdAndIntegrationTypeId
@Modifying @Query(value="DELETE FROM integration WHERE project_id = :projectId AND type = :typeId", nativeQuery=true) int deleteAllByProjectIdAndIntegrationTypeId(@Param("projectId") java.lang.Long projectId, @Param("typeId") java.lang.Long typeId)Delete allIntegrationby projectID and integration type ID- Parameters:
typeId-IntegrationType.id
-
findAllGlobalByType
@Query("SELECT i FROM Integration i WHERE i.project IS NULL AND i.type = :integrationType") java.util.List<Integration> findAllGlobalByType(@Param("integrationType") IntegrationType integrationType)Retrieve allIntegrationwithIntegration.project== null by integration type- Parameters:
integrationType-Integration.type- Returns:
-
findAllProjectByGroup
@Query("SELECT i FROM Integration i JOIN i.type t WHERE i.project = :project AND t.integrationGroup = :integrationGroup") java.util.List<Integration> findAllProjectByGroup(@Param("project") Project project, @Param("integrationGroup") IntegrationGroupEnum integrationGroup)Retrieve allIntegrationwithIntegration.projectby integration group- Parameters:
integrationGroup-IntegrationType.integrationGroup- Returns:
-
findAllGlobalByGroup
@Query("SELECT i FROM Integration i JOIN i.type t WHERE i.project IS NULL AND t.integrationGroup = :integrationGroup") java.util.List<Integration> findAllGlobalByGroup(@Param("integrationGroup") IntegrationGroupEnum integrationGroup)Retrieve allIntegrationwithIntegration.project== null by integration group- Parameters:
integrationGroup-IntegrationType.integrationGroup- Returns:
-
findAllGlobal
@Query("SELECT i FROM Integration i WHERE i.project IS NULL") java.util.List<Integration> findAllGlobal()Retrieve allIntegrationwithIntegration.project== null- Returns:
-
findProjectBtsByUrlAndLinkedProject
@Query(value="SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type, 0 AS clazz_ FROM integration i WHERE (params->\'params\'->>\'url\' = :url AND params->\'params\'->>\'project\' = :btsProject AND i.project_id = :projectId) LIMIT 1", nativeQuery=true) java.util.Optional<Integration> findProjectBtsByUrlAndLinkedProject(@Param("url") java.lang.String url, @Param("btsProject") java.lang.String btsProject, @Param("projectId") java.lang.Long projectId)Find BTS integration by BTS url, BTS project name and Report Portal project id- Parameters:
url- Bug Tracking System urlbtsProject- Bug Tracking System project nameprojectId-Project.id- Returns:
- The
Integrationwrapped in theOptional
-
findGlobalBtsByUrlAndLinkedProject
@Query(value="SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type, 0 AS clazz_ FROM integration i WHERE params->\'params\'->>\'url\' = :url AND i.params->\'params\'->>\'project\' = :btsProject AND i.project_id IS NULL", nativeQuery=true) java.util.Optional<Integration> findGlobalBtsByUrlAndLinkedProject(@Param("url") java.lang.String url, @Param("btsProject") java.lang.String btsProject)Find BTS integration by BTS url, BTS project name andIntegration.project== null- Parameters:
url- Bug Tracking System urlbtsProject- Bug Tracking System project name- Returns:
- The
Integrationwrapped in theOptional
-
updateEnabledStateById
@Modifying @Query(value="UPDATE integration SET enabled = :enabled WHERE id = :integrationId", nativeQuery=true) void updateEnabledStateById(@Param("enabled") boolean enabled, @Param("integrationId") java.lang.Long integrationId)UpdateIntegration.enabledby integration ID- Parameters:
enabled- Enabled state flagintegrationId-Integration.id
-
updateEnabledStateByIntegrationTypeId
@Modifying @Query(value="UPDATE integration SET enabled = :enabled WHERE type = :integrationTypeId", nativeQuery=true) void updateEnabledStateByIntegrationTypeId(@Param("enabled") boolean enabled, @Param("integrationTypeId") java.lang.Long integrationTypeId)UpdateIntegration.enabledof all integrations by integration type id- Parameters:
enabled- Enabled state flagintegrationTypeId-IntegrationType.id
-
findByNameAndTypeId
java.util.Optional<Integration> findByNameAndTypeId(java.lang.String name, java.lang.Long integrationTypeId)
-
findAuthByNameAndTypeName
@Query(value="SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type FROM integration i JOIN integration_type it ON i.type = it.id WHERE i.name = :name AND it.name = :typeName AND it.group_type = cast(\'AUTH\' AS INTEGRATION_GROUP_ENUM)", nativeQuery=true) java.util.Optional<Integration> findAuthByNameAndTypeName(@Param("name") java.lang.String name, @Param("typeName") java.lang.String typeName)
-
findExclusiveAuth
@Query(value="SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type FROM integration i JOIN integration_type it ON i.type = it.id WHERE i.name = :name AND it.name = :name AND it.group_type = cast(\'AUTH\' AS INTEGRATION_GROUP_ENUM)", nativeQuery=true) java.util.Optional<Integration> findExclusiveAuth(@Param("name") java.lang.String name)
-
findAllByTypeIn
@Query(value="SELECT * FROM integration i LEFT OUTER JOIN integration_type it ON i.type = it.id WHERE it.name IN (:types)", nativeQuery=true) java.util.List<Integration> findAllByTypeIn(@Param("types") java.lang.String... types)
-
-