Package com.epam.ta.reportportal.dao
Interface WidgetRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Widget,java.lang.Long>,org.springframework.data.jpa.repository.JpaRepository<Widget,java.lang.Long>,org.springframework.data.repository.PagingAndSortingRepository<Widget,java.lang.Long>,org.springframework.data.repository.query.QueryByExampleExecutor<Widget>,ReportPortalRepository<Widget,java.lang.Long>,org.springframework.data.repository.Repository<Widget,java.lang.Long>,ShareableRepository<Widget>,WidgetRepositoryCustom
public interface WidgetRepository extends ReportPortalRepository<Widget,java.lang.Long>, WidgetRepositoryCustom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanexistsByNameAndOwnerAndProjectId(java.lang.String name, java.lang.String owner, java.lang.Long projectId)Checks the existence of theWidgetwith specified name for a user on a projectjava.util.List<Widget>findAllByProjectId(java.lang.Long projectId)java.util.List<Widget>findAllByProjectIdAndWidgetTypeInAndContentFieldContaining(java.lang.Long projectId, java.util.List<java.lang.String> widgetTypes, java.lang.String contentFieldPart)java.util.List<Widget>findAllByProjectIdAndWidgetTypeInAndContentFieldsContains(java.lang.Long projectId, java.util.List<java.lang.String> widgetTypes, java.lang.String contentField)java.util.Optional<Widget>findByIdAndProjectId(java.lang.Long id, java.lang.Long projectId)Finds widget by 'id' and 'project id'-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
-
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
-
Methods inherited from interface com.epam.ta.reportportal.dao.ShareableRepository
getOwn, getPermitted, getShared
-
Methods inherited from interface com.epam.ta.reportportal.dao.WidgetRepositoryCustom
deleteRelationByFilterIdAndNotOwner
-
-
-
-
Method Detail
-
findByIdAndProjectId
java.util.Optional<Widget> findByIdAndProjectId(java.lang.Long id, java.lang.Long projectId)
Finds widget by 'id' and 'project id'- Parameters:
id-ShareableEntity.idprojectId- Id of theProjectwhose widget will be extracted- Returns:
Widgetwrapped in theOptional
-
findAllByProjectId
java.util.List<Widget> findAllByProjectId(java.lang.Long projectId)
-
existsByNameAndOwnerAndProjectId
boolean existsByNameAndOwnerAndProjectId(java.lang.String name, java.lang.String owner, java.lang.Long projectId)Checks the existence of theWidgetwith specified name for a user on a project- Parameters:
name-Widget.nameowner-ShareableEntity.ownerprojectId- Id of theProjecton which widget existence will be checked- Returns:
- if exists 'true' else 'false'
-
findAllByProjectIdAndWidgetTypeInAndContentFieldsContains
@Query("SELECT w FROM Widget w WHERE w.project.id = :projectId AND w.widgetType IN :widgetTypes AND :contentField MEMBER w.contentFields") java.util.List<Widget> findAllByProjectIdAndWidgetTypeInAndContentFieldsContains(@Param("projectId") java.lang.Long projectId, @Param("widgetTypes") java.util.List<java.lang.String> widgetTypes, @Param("contentField") java.lang.String contentField)
-
findAllByProjectIdAndWidgetTypeInAndContentFieldContaining
@Query(value="SELECT * FROM widget w JOIN shareable_entity se on w.id = se.id JOIN content_field cf on w.id = cf.id WHERE se.project_id = :projectId AND w.widget_type IN :widgetTypes AND cf.field LIKE :contentFieldPart || \'%\'", nativeQuery=true) java.util.List<Widget> findAllByProjectIdAndWidgetTypeInAndContentFieldContaining(@Param("projectId") java.lang.Long projectId, @Param("widgetTypes") java.util.List<java.lang.String> widgetTypes, @Param("contentFieldPart") java.lang.String contentFieldPart)
-
-