2020-07-25 10:38:19 +02:00
|
|
|
package com.plannaplan.repositories;
|
|
|
|
|
|
|
|
import com.plannaplan.entities.User;
|
|
|
|
|
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
2020-09-14 12:39:25 +02:00
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
import org.springframework.data.repository.query.Param;
|
2020-07-25 10:38:19 +02:00
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
|
|
@Repository
|
|
|
|
public interface UserRepository extends JpaRepository<User, Long> {
|
2020-09-14 12:39:25 +02:00
|
|
|
@Query("FROM User WHERE email = ?1")
|
|
|
|
User getByAuthority(@Param("authority") String authority);
|
2020-09-14 14:02:05 +02:00
|
|
|
|
|
|
|
@Query("FROM User WHERE token = ?1")
|
|
|
|
User getByToken(@Param("token") String token);
|
2020-07-25 10:38:19 +02:00
|
|
|
}
|