source: src/main/java/project/educatum/repository/StudentHomeworkRepository.java

Last change on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 797 bytes
Line 
1package project.educatum.repository;
2
3import org.springframework.data.jpa.repository.JpaRepository;
4import org.springframework.data.jpa.repository.Modifying;
5import org.springframework.data.jpa.repository.Query;
6import org.springframework.stereotype.Repository;
7import project.educatum.model.relations.StudentHomeworkRelation;
8import project.educatum.model.primarykeys.StudentHomeworkRelationID;
9
10import javax.transaction.Transactional;
11import java.util.Optional;
12
13@Repository
14public interface StudentHomeworkRepository extends JpaRepository<StudentHomeworkRelation, StudentHomeworkRelationID> {
15
16 @Transactional
17 @Modifying
18 @Query("UPDATE StudentHomeworkRelation h SET h.isDone=true WHERE h.id=:id")
19 void updateDone(Integer id);
20
21 StudentHomeworkRelation findById(Integer id);
22}
Note: See TracBrowser for help on using the repository browser.