2020-07-25 10:21:42 +02:00
|
|
|
package com.plannaplan.repositories;
|
|
|
|
|
2020-09-21 17:45:52 +02:00
|
|
|
import java.util.Optional;
|
|
|
|
|
2020-07-25 10:21:42 +02:00
|
|
|
import com.plannaplan.entities.Lecturer;
|
|
|
|
|
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
2020-08-04 18:15:00 +02:00
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
import org.springframework.data.repository.query.Param;
|
2020-07-25 10:21:42 +02:00
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
2020-11-20 14:50:07 +01:00
|
|
|
/**
|
|
|
|
* LecturerRepository.find:
|
|
|
|
* Return list of:
|
|
|
|
* SELECT * FROM Lecturer WHERE title = i AND name = j AND surname = k.
|
|
|
|
*
|
|
|
|
* Where i, j, k, ?1, ?2, ?3 are equale to variables.
|
|
|
|
*/
|
2020-07-25 10:21:42 +02:00
|
|
|
@Repository
|
|
|
|
public interface LecturerRepository extends JpaRepository<Lecturer, Long> {
|
2020-09-02 16:56:49 +02:00
|
|
|
@Query("FROM Lecturer WHERE title = ?1 AND name = ?2 AND surname = ?3")
|
2020-09-21 17:45:52 +02:00
|
|
|
Optional<Lecturer> find(@Param("title") String title, @Param("name") String name, @Param("surname") String surname);
|
2020-07-25 10:21:42 +02:00
|
|
|
}
|