Created first Api implementation
This commit is contained in:
@ -1,14 +1,18 @@
|
||||
package mops.gruppen2.repository;
|
||||
|
||||
import mops.gruppen2.domain.EventDTO;
|
||||
import mops.gruppen2.domain.event.Event;
|
||||
import org.springframework.data.jdbc.repository.query.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface EventRepository extends CrudRepository<EventDTO, Long> {
|
||||
@Query("SELECT * FROM event WHERE event_id > ?#{[0]}")
|
||||
@Query("SELECT * FROM event WHERE event_id > @status")
|
||||
public Iterable<EventDTO> findNewEventSinceStatus(@Param("status") Long status);
|
||||
|
||||
@Query("SELECT * FROM event WHERE group_id IN @groupIds ")
|
||||
public Iterable<EventDTO> findAllEventsOfGroups(@Param("groupIds") List<Long> groupIds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user