package org.hso.ecommerce.db;

import org.hso.ecommerce.entities.Customer;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface CustomerRepository extends CrudRepository<Customer, Long> {

    @Query("SELECT * FROM customer WHERE lastName = :lastName")
    List<Customer> findByLastname(String lastName);

    @Query("SELECT * FROM customer WHERE username = :username")
    List<Customer> findByUsername(String username);
}


