Created
January 22, 2022 19:49
-
-
Save httpmurilo/112ad35ce6ab5ddb869eacbb6bcafc73 to your computer and use it in GitHub Desktop.
CustomerRepository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.murilo.store.repository; | |
import io.murilo.store.model.Customer; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
import org.springframework.data.repository.query.Param; | |
import org.springframework.data.rest.core.annotation.RepositoryRestResource; | |
import java.util.List; | |
import java.util.Optional; | |
@RepositoryRestResource(path = "customer") | |
public interface CustomerRepository extends JpaRepository<Customer, Integer> { | |
List<Customer> findByName(@Param("name") String name); | |
Optional<Customer> findById(Integer id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment