Package com.alpaca.repository
Interface AdvertiserRepo
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Advertiser,
,UUID> GenericRepo<Advertiser,
,UUID> org.springframework.data.jpa.repository.JpaRepository<Advertiser,
,UUID> org.springframework.data.repository.ListCrudRepository<Advertiser,
,UUID> org.springframework.data.repository.ListPagingAndSortingRepository<Advertiser,
,UUID> org.springframework.data.repository.PagingAndSortingRepository<Advertiser,
,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<Advertiser>
,org.springframework.data.repository.Repository<Advertiser,
UUID>
Repository interface for managing
Advertiser
entities.
Extends GenericRepo
to inherit common CRUD operations and defines additional queries
for permission-specific operations.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlong
countByUserId
(UUID userId) Counts the number of advertisers associated with a specific user ID.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface com.alpaca.repository.GenericRepo
countByIds
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, findAll, findAll, flush, getReferenceById, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAll
Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
countByUserId
@Query("SELECT COUNT(p) FROM Advertiser p WHERE p.user.id = :userId") long countByUserId(@Param("userId") UUID userId) Counts the number of advertisers associated with a specific user ID.- Parameters:
userId
- The ID of the user - must not be null.- Returns:
- The number of advertisers linked to the given user.
-