contact controller et repo

This commit is contained in:
Blandine Bajard 2022-01-19 10:22:28 +01:00
parent 456e44af4d
commit f6afef809d
5 changed files with 105 additions and 28 deletions

View file

@ -1,4 +1,19 @@
package fr.organizee.repository;
public interface ContactRepository {
import fr.organizee.model.Contact;
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;
import java.util.List;
import java.util.Optional;
@Repository
public interface ContactRepository extends JpaRepository<Contact, Integer> {
@Query(value = "select * from contact where team_id = :team_id", nativeQuery = true)
List<Contact> FindContactsByTeam(@Param("team_id") int team_id);
}