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 TypeMethodDescriptionlongcountByUserId(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, saveMethods inherited from interface com.alpaca.repository.GenericRepo
countByIdsMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, findAll, findAll, flush, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods 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.
-