contact controller et repo
This commit is contained in:
parent
456e44af4d
commit
f6afef809d
5 changed files with 105 additions and 28 deletions
|
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue