Interface UserBackofficeRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<UserBackoffice,String>, org.springframework.data.jpa.repository.JpaRepository<UserBackoffice,String>, org.springframework.data.repository.PagingAndSortingRepository<UserBackoffice,String>, org.springframework.data.repository.query.QueryByExampleExecutor<UserBackoffice>, org.springframework.data.repository.Repository<UserBackoffice,String>

@Repository public interface UserBackofficeRepository extends org.springframework.data.jpa.repository.JpaRepository<UserBackoffice,String>
Repository interface to do queries for UserBackoffice data.
  • Method Summary

    Modifier and Type
    Method
    Description
    findByCoreUserIdAndBackofficeId(String coreUserId, Integer backofficeId)
    query for filter by params.
    findByUserAndBackofficeId(User user, Integer backofficeId)
    Find data by user and backoffice identifier.
    Get all the given user back offices.
    Get the given core user id for specific backoffice id and user id.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush

    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

    • findByUserAndBackofficeId

      Optional<UserBackoffice> findByUserAndBackofficeId(User user, Integer backofficeId)
      Find data by user and backoffice identifier.
      Parameters:
      user - the user
      backofficeId - the backoffice identifier
      Returns:
      the userbackofice data
    • findByUserId

      @Query(value="SELECT * FROM user_backoffice WHERE user_id = ?1", nativeQuery=true) List<UserBackoffice> findByUserId(String userId)
      Get all the given user back offices.
      Parameters:
      userId - user identifier.
      Returns:
      the given user back offices.
    • findCoreUserIdByUserIdAndBackofficeId

      @Query(value="SELECT core_user_id FROM user_backoffice WHERE user_id = ?1 and backoffice_id = ?2", nativeQuery=true) String findCoreUserIdByUserIdAndBackofficeId(String userId, Integer backofficeId)
      Get the given core user id for specific backoffice id and user id.
      Parameters:
      userId - user identifier.
      backofficeId - backoffice identifier.
      Returns:
      the given user back offices.
    • findByCoreUserIdAndBackofficeId

      @Query("select ud from UserBackoffice ud where ud.coreUserId = :coreUserId and ud.backofficeId = :backofficeId") UserBackoffice findByCoreUserIdAndBackofficeId(@Param("coreUserId") String coreUserId, @Param("backofficeId") Integer backofficeId)
      query for filter by params.
      Parameters:
      coreUserId - user identifier.
      backofficeId - back office Id.
      Returns:
      UserBackoffice in database.