@Repository public interface UserRepository extends JpaRepository<User, Long> { @Query("select u from User u where lower(u.username) = lower(?1)") Optional<User> findByUsername(String username); }