Interface UserRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<User,,String> org.springframework.data.jpa.repository.JpaRepository<User,,String> org.springframework.data.repository.PagingAndSortingRepository<User,,String> org.springframework.data.repository.query.QueryByExampleExecutor<User>,org.springframework.data.repository.Repository<User,String>
@Repository
public interface UserRepository
extends org.springframework.data.jpa.repository.JpaRepository<User,String>
Repository for queries for User.
-
Method Summary
Modifier and TypeMethodDescriptionfindbyUserDocument(String documentId) Select registers by documentId.findbyUserDocumentLike(String documentId) Select registers by documentId.findUserByEmailOrPhone(String email, String phone) Select registers by email and phone.findUserByIdClient(String id, String name) Select registers by User state.Get next value for User Code sequence.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
-
getUserCodeNextValue
Get next value for User Code sequence.- Returns:
- sequence value
-
findbyUserDocumentLike
@Query("SELECT u FROM User u WHERE u.documentId like :documentId") List<User> findbyUserDocumentLike(@Param("documentId") String documentId) Select registers by documentId.- Parameters:
documentId- identifier for document .- Returns:
- User object from database
-
findbyUserDocument
@Query("SELECT u FROM User u WHERE u.documentId = :documentId") Optional<User> findbyUserDocument(@Param("documentId") String documentId) Select registers by documentId.- Parameters:
documentId- identifier for document .- Returns:
- User object from database
-
findUserByEmailOrPhone
@Query("SELECT u FROM User u WHERE u.email = :email OR u.phone = :phone") List<User> findUserByEmailOrPhone(@Param("email") String email, @Param("phone") String phone) Select registers by email and phone.- Parameters:
email- user email .phone- user phone number .- Returns:
- User object from database
-
findUserByIdClient
@Query("SELECT u FROM User u WHERE u.id = :id AND u.state.name = :name") User findUserByIdClient(@Param("id") String id, @Param("name") String name) Select registers by User state.- Parameters:
id- identifier for user .name- name for user state.- Returns:
- User object from database
-