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 for queries for user devices.
-
Method Summary
Modifier and TypeMethodDescriptionfindBackofficeIdByUserId(String userId) Get all the given user back offices.findByCoreUserIdAndBackofficeId(String coreUserId, Integer backOfficeId) query for filter by params.findByCoreUserIdAndBackofficeIdAndCompany(String coreUserId, Integer backOfficeId, String company) Get user backoffice by core user identifier, backoffice identifier and company.findByUserId(String userId) Get all the given user back offices.findByUserIdAndBackofficeId(String userId, Integer backOfficeId) Get a userBackoffice by id.findCoreUserIdByUserIdAndBackofficeId(String userId, Integer backOfficeId) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods 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
-
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.
-
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.
-
findBackofficeIdByUserId
@Query(value="SELECT backoffice_id FROM user_backoffice WHERE user_id = ?1", nativeQuery=true) List<String> findBackofficeIdByUserId(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.
-
findByCoreUserIdAndBackofficeIdAndCompany
@Query("select ud from UserBackoffice ud where ud.coreUserId = :coreUserId and ud.backOfficeId = :backOfficeId and ud.user.companyId = :company") UserBackoffice findByCoreUserIdAndBackofficeIdAndCompany(@Param("coreUserId") String coreUserId, @Param("backOfficeId") Integer backOfficeId, @Param("company") String company) Get user backoffice by core user identifier, backoffice identifier and company.- Parameters:
coreUserId- Core user identifierbackOfficeId- Backoffice identifiercompany- Company- Returns:
- UserBackoffice in database
-
findByUserIdAndBackofficeId
@Query("select ud from UserBackoffice ud where ud.user.id = :userId and ud.backOfficeId = :backOfficeId") UserBackoffice findByUserIdAndBackofficeId(@Param("userId") String userId, @Param("backOfficeId") Integer backOfficeId) Get a userBackoffice by id.- Parameters:
userId- user identifier.backOfficeId- backoffice identifier.- Returns:
- UserBackoffice in database.
-