package bg.car_wash.areas.user.repositories;

import bg.car_wash.areas.user.entity.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends CrudRepository<User, Long> {

//	@Query("SELECT u FROM User AS u WHERE u.email = :email AND u.password = :password")
	User findUserByEmailAndPassword(@Param("email") String email, @Param("password") String password);

	List<User> findAll();

	User findOneByUsername(String username);
}

@@ -441,16 +441,18 @@
 sword%22)%0A
+//
 %09User fi
@@ -587,32 +587,26 @@
 neBy
-Username(String username
+Email(String email
 );%0A%7D

change findOneByUsername to findOneByEmail