Interface ProfileRepo

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Profile,UUID>, GenericRepo<Profile,UUID>, org.springframework.data.jpa.repository.JpaRepository<Profile,UUID>, org.springframework.data.repository.ListCrudRepository<Profile,UUID>, org.springframework.data.repository.ListPagingAndSortingRepository<Profile,UUID>, org.springframework.data.repository.PagingAndSortingRepository<Profile,UUID>, org.springframework.data.repository.query.QueryByExampleExecutor<Profile>, org.springframework.data.repository.Repository<Profile,UUID>

@Repository public interface ProfileRepo extends GenericRepo<Profile,UUID>
Repository interface for managing Profile entities.

Extends GenericRepo to inherit common CRUD operations and defines additional queries for profile-specific operations.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Counts the number of profiles 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 Profile p WHERE p.user.id = :userId") long countByUserId(@Param("userId") UUID userId)
      Counts the number of profiles associated with a specific user ID.
      Parameters:
      userId - The ID of the user - must not be null.
      Returns:
      The number of profiles linked to the given user.