package com.rizki.mufrizal.belajar.oauth2.repository;

import com.rizki.mufrizal.belajar.oauth2.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User, String> {
    @Query("select u from User u left join fetch u.userRoles pd where u.username = :username")
    public User getUserByUsername(@Param("username") String username);
}

@@ -483,28 +483,22 @@
 e u.
-username = :username
+email = :email
 %22)%0A 
@@ -538,24 +538,21 @@
 @Param(%22
-username
+email
 %22) Strin
@@ -557,16 +557,13 @@
 ing 
-username
+email
 );%0A%7D

Change Query