2020-07-25 10:38:19 +02:00
|
|
|
package com.plannaplan.repositories;
|
|
|
|
|
2020-09-30 19:15:32 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2020-07-25 10:38:19 +02:00
|
|
|
import com.plannaplan.entities.Assignment;
|
|
|
|
|
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
2020-09-30 19:15:32 +02:00
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
import org.springframework.data.repository.query.Param;
|
2020-07-25 10:38:19 +02:00
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
2020-11-20 14:50:07 +01:00
|
|
|
/**
|
|
|
|
* AssignmentRepository.getByCommision:
|
|
|
|
* Return list of:
|
|
|
|
* SELECT * FROM Assignment WHERE commision_id = i .
|
|
|
|
*
|
|
|
|
* Where i, ?1 are equale to variables.
|
|
|
|
*/
|
2020-07-25 10:38:19 +02:00
|
|
|
@Repository
|
|
|
|
public interface AssignmentRepository extends JpaRepository<Assignment, Long> {
|
|
|
|
|
2020-09-30 19:15:32 +02:00
|
|
|
@Query("FROM Assignment WHERE commision_id = ?1")
|
|
|
|
List<Assignment> getByCommision(@Param("commision_id") Long id);
|
|
|
|
|
2020-07-25 10:38:19 +02:00
|
|
|
}
|