Check it !!! UserRepository.java

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-11-20 14:53:45 +01:00
parent 50c1397db2
commit 85052f5728
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -11,6 +11,32 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* UserRepository.getByAuthority:
* Return list of:
* SELECT * FROM User WHERE email = i.
*
* Where i, ?1 are equale to variables.
*
* UserRepository.getByToken:
* Return list of:
* SELECT * FROM User WHERE token = i.
*
* Where i, ?1 are equale to variables.
*
* UserRepository.searchForUsers:
* Return list of:
* SELECT * FROM User WHERE (name LIKE %?1% OR surname LIKE %?1%).
*
* Where i, ?1 are equale to variables.
*
* UserRepository.searchForUsers with role:
* Return list of:
* SELECT * FROM User WHERE (name LIKE %?1% OR surname LIKE %?1%) AND role=?2").
*
* Where i, ?1 are equale to variables.
*/
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
@Query("FROM User WHERE email = ?1")