access modifiers and constructors fix

This commit is contained in:
Filip Izydorczyk
2020-09-25 17:01:38 +02:00
parent 44bcc24110
commit 15a4c526b4
4 changed files with 7 additions and 15 deletions

View File

@ -9,12 +9,11 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
//if result could be null, should we wrapped in optional
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
@Query("FROM User WHERE email = ?1")
Optional<User> getByAuthority(@Param("authority") String authority);
@Query("FROM User WHERE token = ?1")
User getByToken(@Param("token") String token);
Optional<User> getByToken(@Param("token") String token);
}